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’ll 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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ repos:
hooks:
- id: prettier
types_or: [yaml]
- repo: https://github.com/citation-file-format/cffconvert
rev: "054bda51dbe278b3e86f27c890e3f3ac877d616c"
Copy link
Author

@MattF-NSIDC MattF-NSIDC Dec 7, 2023

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

hooks:
- id: "validate-cff"
args:
- "--verbose"
Copy link
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
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.

105 changes: 59 additions & 46 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ message: |
Authors are listed in alphabetical order.

title: "earthaccess"
doi: "https://doi.org/10.5281/zenodo.8365009"
doi: "10.5281/zenodo.8365009"
abstract: "Python Library for NASA Earthdata APIs"
contact:
- name: "The earthaccess community"
website: "https://github.com/nsidc/earthaccess/discussions"
- name: "NSIDC"
email: "nsidc@nsidc.org"
type: "software"
license: ["MIT"]
# 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
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.

keywords:
- "data"
- "Remote sensing"
Expand All @@ -27,51 +30,61 @@ version: "0.8.2"
date-released: "2023-12-06"

authors:
- family-names: "Barrett"
given-names: "Andrew"
orcid: "https://orcid.org/0000-0003-4394-5445"
website: "https://github.com/andypbarrett"
- family-names: "Battisto"
given-names: "Chris"
orcid: "https://orcid.org//0000-0002-9608-3634"
website: "https://github.com/battistowx"
- family-names: "Bourbeau"
given-names: "James"
orcid: "https://orcid.org/0000-0003-2164-7789"
website: "https://github.com/jrbourbeau"
- family-names: "Fisher"
given-names: "Matt"
orcid: "https://orcid.org/0000-0003-3260-5445"
website: "https://mfisher87.github.io/"
- family-names: "Kaufman"
given-names: "Daniel"
orcid: "https://orcid.org/0000-0002-1487-7298"
website: "https://github.com/danielfromearth"
- family-names: "Kennedy"
given-names: "Joseph"
orcid: "https://orcid.org/0000-0002-9348-693X"
website: "https://github.com/jhkennedy"
- family-names: "Lopez"
given-names: "Luis"
orcid: "https://orcid.org/0000-0003-4896-3263"
website: "https://github.com/betolink"
- family-names: "Lowndes"
given-names: "Julia"
orcid: "https://orcid.org/0000-0003-1682-3872"
website: "https://github.com/jules32"
- family-names: "Scheick"
given-names: "Jessica"
orcid: "https://orcid.org/0000-0002-3421-4459"
website: "https://github.com/JessicaS11"
- family-names: "Steiker"
given-names: "Amy"
orcid: "https://orcid.org/0000-0002-3039-0260"
website: "https://github.com/asteiker"
- family-names: "Barrett"
given-names: "Andrew"
orcid: "https://orcid.org/0000-0003-4394-5445"
website: "https://github.com/andypbarrett"
- family-names: "Battisto"
given-names: "Chris"
orcid: "https://orcid.org/0000-0002-9608-3634"
website: "https://github.com/battistowx"
- family-names: "Bourbeau"
given-names: "James"
orcid: "https://orcid.org/0000-0003-2164-7789"
website: "https://github.com/jrbourbeau"
- family-names: "Fisher"
given-names: "Matt"
orcid: "https://orcid.org/0000-0003-3260-5445"
website: "https://mfisher87.github.io/"
- family-names: "Kaufman"
given-names: "Daniel"
orcid: "https://orcid.org/0000-0002-1487-7298"
website: "https://github.com/danielfromearth"
- family-names: "Kennedy"
given-names: "Joseph"
orcid: "https://orcid.org/0000-0002-9348-693X"
website: "https://github.com/jhkennedy"
- family-names: "Lopez"
given-names: "Luis"
orcid: "https://orcid.org/0000-0003-4896-3263"
website: "https://github.com/betolink"
- family-names: "Lowndes"
given-names: "Julia"
orcid: "https://orcid.org/0000-0003-1682-3872"
website: "https://github.com/jules32"
- family-names: "Scheick"
given-names: "Jessica"
orcid: "https://orcid.org/0000-0002-3421-4459"
website: "https://github.com/JessicaS11"
- family-names: "Steiker"
given-names: "Amy"
orcid: "https://orcid.org/0000-0002-3039-0260"
website: "https://github.com/asteiker"



references:
- type: "grant"
institution:
name: "National Aeronautics and Space Administration"
number: "20-TWSC20-2-0003"
- type: "grant"
title: "Openscapes: Supporting better science for future us"
institution:
name: "National Aeronautics and Space Administration"
number: "20-TWSC20-2-0003"
authors:
- family-names: "Lowndes"
given-names: "Julia"
orcid: "https://orcid.org/0000-0003-1682-3872"
website: "https://github.com/jules32"
MattF-NSIDC marked this conversation as resolved.
Show resolved Hide resolved
- family-names: "Robinson"
given-names: "Erin"
orcid: "https://orcid.org/0000-0001-9998-0114"
website: "https://erinrobinson.info/"
Loading