-
Notifications
You must be signed in to change notification settings - Fork 235
Add pre-commit config with pre-commit-hooks #3283
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
Changes from 4 commits
93dc844
0d17730
8176a18
4ae3ba5
c23f776
ce6d457
5a01ad6
a444d33
b3eee6f
d937cac
0f09fb6
386ad8e
25652fc
f505a99
7b67296
533dc4f
10ccc9b
70414ac
c0e6930
b606f7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # See https://pre-commit.com for more information | ||
| # See https://pre-commit.com/hooks.html for more hooks | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.6.0 | ||
| hooks: | ||
| - id: check-added-large-files | ||
| - id: check-yaml | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
|
|
||
| # https://pre-commit.ci/#configuration | ||
| ci: | ||
| autofix_prs: false | ||
| autoupdate_schedule: quarterly | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| All participants in the PyGMT community must abide by | ||
| the [Generic Mapping Tools organization Code of Conduct](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md). | ||
| the [Generic Mapping Tools organization Code of Conduct](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,4 +30,3 @@ | |
| .. raw:: html | ||
|
|
||
| <div style='clear:both'></div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,3 @@ | |
| .. raw:: html | ||
|
|
||
| <div style='clear:both'></div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,4 +10,3 @@ | |
| .. raw:: html | ||
|
|
||
| <div style='clear:both'></div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -485,8 +485,8 @@ For consistency, we also use UNIX-style line endings (`\n`) and file permission | |
| 644 (`-rw-r--r--`) throughout the whole project. | ||
| Don't worry if you forget to do it. Our continuous integration systems will | ||
| warn us and you can make a new commit with the formatted code. | ||
| Even better, you can just write `/format` in the first line of any comment in a | ||
| pull request to lint the code automatically. | ||
| Even better, you can just write `/format` and/or `pre-commit.ci autofix` in the first | ||
weiji14 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| line of any comment in a pull request to lint the code automatically. | ||
|
||
|
|
||
| When wrapping a new alias, use an underscore to separate words bridged by vowels | ||
| (aeiou), such as `no_skip` and `z_only`. Do not use an underscore to separate | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,4 +116,3 @@ year will be moved to Distinguished Contributors. | |
| :::: | ||
|
|
||
| ::::: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,4 @@ | |
| 600 A | ||
| 700 C | ||
| 800 A | ||
| 900 C | ||
| 900 C | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
Can also add these hooks from https://github.com/Lucas-C/pre-commit-hooks that handle LF file endings and 644 permissions? (Then we can remove these lines from style_checks.yml).
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 good.
Uh oh!
There was an error while loading. Please reload this page.
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.
Hmm, not sure why, but pre-commit.ci seeems to think our files have 664 permission instead of 644? See logs at https://results.pre-commit.ci/run/github/85352251/1717481309.E-FyucnQQ_CvuFT06LGuHg
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've added back the GitHub Action workflows for 644 permission checks/formatting for now at commit 5a01ad6.
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.
Since we're not using pre-commit.ci anymore but just GitHub Actions, I've reinstated the 644 pre-commit hook in the YAML file. Seems to be working at https://github.com/GenericMappingTools/pygmt/actions/runs/9458943127/job/26055263366?pr=3283#step:5:31: