-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add first implementation of papis-doctor #421
Add first implementation of papis-doctor #421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of nitpicks, but overall this works for me as advertised! Even found a document without a title 🎉
The only higher level suggestion I would have is to call these things checks
instead of tests
? i.e. REGISTERED_CHECKS
, etc. Sounds a bit less CS-y maybe..
Co-authored-by: Alex Fikl <alexfikl@gmail.com>
Co-authored-by: Alex Fikl <alexfikl@gmail.com>
Yes I agree, i changed the names to check in all related parts, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely useful. I only have some general remarks:
- the author check would be more useful if it weren't triggered when an editor is defined instead (I get around 100 files simply because they are collections with just an editor defined)
- maybe the message could be "keys X missing" just to be more explicit
- might be cool to offer going through the list of errors one by one and offering to e.g. ignore/edit info.yaml
- might also be cool to somehow do a check automatically when adding new entries to the library (not quite sure how or at what stage though)
- i think checking for non-unique refs would be useful!
thank you for the suggestions! |
Looking at #412 made me realise it might be useful for papis-doctor to also by default check whether entries have a (valid) |
that's a great idea, I'll implement the check |
I've come across some things that could benefit from being detected here:
|
|
This should help in 3rd party applications handling of notes, like webapp and editro plugins
I'll merge this behemoth because I want to start with the |
As we discussed some time ago, that would be nice to have a
papis doctor
functionality.o
I have prepared a first implementation of a candidate.
In principle one implement different tests
and then queries the library like on all other commands.
Right now there are two tests implemented,
one that looks for missing keys and another one that
checks if the
files
of the documents actually exists.Here is an output from my library.
For library writers I've also implemented a
--json
exporterAlso as you see in the json output, I thought maybe it's good
to have a suggestion function per test checked,
in text output there is the
--suggest
option> papis doctor --suggest --all ... keys ref /home/gallo/Documents/papers/05e50e4ea461ea527851f947086c9d5b Suggestion: papis update --doc-folder /home/gallo/Documents/papers/05e50e4ea461ea527851f947086c9d5b files /home/gallo/Documents/papers/1db30a88d9ad08ebbf76ee84bcc295f6-pederson-mark-r.-an/improved-theoretical-methods-for-studies-of-defects-in-insulators-application-to-the-pederson-mark-r.-and-klein-barry-m.pdf /home/gallo/Documents/papers/1db30a88d9ad08ebbf76ee84bcc295f6-pederson-mark-r.-an Suggestion: papis edit --doc-folder /home/gallo/Documents/papers/1db30a88d9ad08ebbf76ee84bcc295f6-pederson-mark-r.-an
I would say there is now the time to discuss what would be the
intended usage and the ergonomic use of the command.
Also, the code is quite straightforwardly implemented I think.