-
Notifications
You must be signed in to change notification settings - Fork 224
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 pre-commit.ci configurations to enable auto updates of hooks #3414
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9bcb445
Temporarily set pre-commit-hooks to old tag
seisman 24cc991
Autoupdate pre-commit hooks in the Style Checks workflow
seisman 657c50c
Fail the workflow if there are newer hooks
seisman 4d2af04
Add workflow_dispatch so the workflow can be triggered manually
seisman 6458bb3
Enable the workflow in schedule or workflow_dispatch events
seisman 5dda2c2
Merge branch 'main' into ci/pre-commit
seisman 359e1c9
Revert changes in style checks workflow
seisman e789f55
Revert temporary changes in .pre-commit-config.yaml
seisman 6709bfa
Add configurations for pre-commit.ci
seisman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe run the autoupdate line only on cron jobs? So that PRs don't get slowed down by sudden Style Check changes.
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.
OK. I've added the if-condition so that the autoupdate command only runs on schedule or workflow_dispatch events. It means we have to check https://github.com/GenericMappingTools/pygmt/actions/workflows/style_checks.yaml to know if there are new versions for hooks. Maybe we should automatically open a PR if there are updates?
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.
Maybe we could just use pre-commit.ci as was tried in #3283? The automation would require quite a bit of code to set up. Ideally we could use dependabot but looking at dependabot/dependabot-core#1524, it's still not working yet.
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'm OK with enabling pre-commit.ci for auto update.
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.
Ok, add these lines to
.pre-commit-config.yaml
: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.
The pre-commit.ci App is also installed https://github.com/GenericMappingTools/pygmt/settings/installations.