-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Enforce Repo-Review rules #2075
Conversation
b651f1a
to
42a44de
Compare
- repo: https://github.com/scientific-python/cookie | ||
rev: 2024.04.23 | ||
hooks: | ||
- id: sp-repo-review |
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.
- repo: https://github.com/scientific-python/cookie | |
rev: 2024.04.23 | |
hooks: | |
- id: sp-repo-review | |
- repo: https://github.com/scientific-python/repo-review | |
rev: 0.11 | |
hooks: | |
- id: repo-review |
I think better to use the repo-review repository itself?
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.
I understand sp-repo-review/cookie should be used to evaluate repos against the guidelines in the Scientific Python Library Development Guide. The repo-review framework has sp-repo-review and validate-pyproject plugins.
The repo-review documentation suggests we should directly use the plugin we're interested in:
Pre-commit
You can also use this from pre-commit:
- repo: https://github.com/scientific-python/repo-review rev: <version> hooks: - id: repo-review additional_dependencies: ["repo-review[cli]", "sp-repo-review==<version>"](Insert the current version above, and ideally pin the plugin version, as long as you have a way to auto-update it.)
Though check your favorite plugin, which might directly support running from pre-commit, and then pre-commit’s pinning system will pin on your plugin, rather than the framework (repo-review).
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.
In that example they use https://github.com/scientific-python/repo-review instead of https://github.com/scientific-python/cookie, so I think it's best to change it from cookie
to repo-review
?
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.
It depends on who applied the relevant commit. Let me investigate.
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.
It goes on with:
⚠ Warning
This currently has a couple of weird quirks. Pre-commit will not report the correct version for repo-review (it’s always 0.1), and it will lose the cli requirements if you add additional dependencies (which you always do, it’s a plugin framework, so it needs plugins). To counter this, plugins can avoid lower bounds and you can manually add repo-review[cli], as seen above, or plugins can provide their own hooks (like sp-repo-review also does).
In the future, a mirror will be set up so that we can avoid these issues.
42a44de
to
1d3f86d
Compare
d86f7f9
to
aa61bee
Compare
aa61bee
to
23fbdab
Compare
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.
Looks 👍 - just another question about which repository we should be running the pre-commit hook from
https://learn.scientific-python.org/development/guides/repo-review/?repo=zarr-developers%2Fzarr-python&branch=v3
TODO: