citation-file-format / cffconvert

Command line program to validate and convert CITATION.cff files.
Apache License 2.0
100 stars 28 forks source link

Provide pre-commit hook #269

Closed zmoon closed 2 years ago

zmoon commented 2 years ago

Closes #268

This seems to work fine. The issue is that if the validation doesn't pass, some errors cause the whole schema to be printed, which takes a lot of lines, so you have to scroll far up to find the actual helpful message.

zmoon commented 2 years ago

Maybe the hook name should be validate-cff instead

zmoon commented 2 years ago

Found it doesn't currently work if multiple .cff files, gonna try to fix that.

zmoon commented 2 years ago

I couldn't get it to work with multiple .cff files, because it passes all of them, and cffconvert -i only supports passing one. So I changed it to only validate the CITATION.cff file, which lines up with what the Action does by default I think.

jspaaks commented 2 years ago

I couldn't get it to work with multiple .cff files, because it passes all of them, and cffconvert -i only supports passing one. So I changed it to only validate the CITATION.cff file, which lines up with what the Action does by default I think.

Yep the Citation File Format specification requires the exact filename "CITATION.cff" anyway (see here), so I'm good with just running on that.

jspaaks commented 2 years ago

Thanks for making this PR