Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CITATION.cff to fix Zenodo, add CFF validator #408

Merged
merged 4 commits into from
Dec 11, 2023
Merged

Conversation

MattF-NSIDC
Copy link
Member

@MattF-NSIDC MattF-NSIDC commented Dec 7, 2023

Currently, Zenodo is unhappy with array values for license. This violates the CFF spec. The related GitHub issue is added as a comment in this PR.

Resolves #407

This has been (silently) going on for about a month, so our last DOI'd release is 0.6.1 馃槶 I added the new pre-commit check to hopefully avoid this going forward, but for this particular issue, it wouldn't have helped, since it implements the spec more accurately than Zenodo (for this particular field at least).

Currently, Zenodo is unhappy with array values for `license`. This
violates the CFF spec. The related GitHub issue is added as a comment in
this commit.
There was an extra slash in Chris' author.orcid entry.
@MattF-NSIDC MattF-NSIDC changed the title Change CITATION.cff to fix Zenodo, add CFF validator Update CITATION.cff to fix Zenodo, add CFF validator Dec 7, 2023
# NOTE: The CFF spec says `license` can be a list, but Zenodo is currently not
# accepting lists for this key:
# https://github.com/zenodo/zenodo/issues/2515
license: "MIT"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the thing that broke everything. All the other changes are from adding the validator.

hooks:
- id: "validate-cff"
args:
- "--verbose"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hoped to also get pre-commit to recognize CFF as type: yaml for prettier but it turns out there are very good reasons not to do that, and my PR wasn't accepted (pre-commit/identify#435).

I don't know of a good escape hatch that will let us run prettier on CFF without also needing to maintain a regex to exclude all other files of "text" type. Prettier correctly detects CFF as YAML and formats it the way we would want. It's just pre-commit that we would need a workaround for. Any thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought of one. We could have the prettier hook run twice; once for the normal stuff we want to format, and again ONLY for CITATION.cff!

  - repo: "https://github.com/pre-commit/mirrors-prettier"
    rev: "v3.1.0"
    hooks:
      - id: "prettier"
        files: "CITATION.cff"

I'd need to test it. But I don't have time right now.

@jules32
Copy link
Contributor

jules32 commented Dec 7, 2023

Woot woot thanks Matt! Added a comment above :)

@@ -22,3 +22,9 @@ repos:
hooks:
- id: prettier
types_or: [yaml]
- repo: https://github.com/citation-file-format/cffconvert
rev: "054bda51dbe278b3e86f27c890e3f3ac877d616c"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this either, but it's what they documented, and the alternative I tried does not work. Opened issue: citation-file-format/cffconvert#375

@MattF-NSIDC
Copy link
Member Author

If anyone approves, this is ready to merge on my end, so go for it :)

Copy link
Member

@betolink betolink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing it Matt!

@mfisher87 mfisher87 merged commit 1d0334d into main Dec 11, 2023
13 checks passed
@mfisher87 mfisher87 deleted the fix-zenodo branch December 11, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Zenodo and add CFF validator pre-commit hook
4 participants