-
Notifications
You must be signed in to change notification settings - Fork 76
Add initial pre-commit configuration #1280
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
base: master
Are you sure you want to change the base?
Changes from all commits
a06d0fd
42778c9
d99cc4b
7d048e6
9517cc7
1ec00fd
43b37ad
e8ef463
4ca9b57
ba33fc5
30aa4f2
1dee36b
6c15e15
87212d2
db55a03
e011f53
8e93f92
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,98 @@ | ||
| # Configuration file for pre-commit and pre-commit.ci. | ||
| # | ||
| # To perform automated fixes, either run `pre-commit run --all-files` | ||
| # or comment `pre-commit.ci autofix` on a pull request. | ||
|
|
||
| ci: # https://pre-commit.ci/#configuration | ||
| autofix_prs: false | ||
| autoupdate_schedule: monthly | ||
|
|
||
| repos: # https://pre-commit.com/#adding-pre-commit-plugins-to-your-project | ||
|
|
||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-ast | ||
| name: check abstract syntax tree | ||
| - id: check-merge-conflict | ||
| - id: check-case-conflict | ||
| - id: check-illegal-windows-names | ||
| - id: detect-private-key | ||
| - id: fix-byte-order-marker | ||
| - id: mixed-line-ending | ||
| args: [--fix=lf] | ||
| exclude: docs/make.bat | ||
| - id: forbid-submodules | ||
| - id: check-toml | ||
| - id: check-yaml | ||
| # - id: trailing-whitespace | ||
| # - id: end-of-file-fixer | ||
| # - id: name-tests-test | ||
|
|
||
| - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks | ||
| rev: v2.15.0 | ||
| hooks: | ||
| - id: pretty-format-yaml | ||
| args: [--autofix] | ||
| files: .pre-commit-config.yaml | ||
| # - id: pretty-format-ini | ||
| # args: [--autofix] | ||
|
|
||
| - repo: https://github.com/sirosen/texthooks | ||
| rev: 0.7.1 | ||
| hooks: | ||
| # - id: fix-smartquotes | ||
| - id: fix-spaces | ||
| - id: fix-ligatures | ||
| - id: forbid-bidi-controls | ||
|
|
||
| #- repo: https://github.com/astral-sh/ruff-pre-commit | ||
| # rev: v0.14.5 | ||
| # hooks: | ||
| # - id: ruff-check | ||
| # name: ruff-check (see https://docs.astral.sh/ruff/rules) | ||
| # args: [--fix] | ||
| # - id: ruff-format | ||
|
|
||
| #- repo: https://github.com/sphinx-contrib/sphinx-lint | ||
| # rev: v1.0.1 | ||
| # hooks: | ||
| # - id: sphinx-lint | ||
|
|
||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.4.1 | ||
| hooks: | ||
| - id: codespell | ||
| name: codespell (add false positives to pyproject.toml) | ||
| # temporarily exclude most files since suggested changes require some thought | ||
| exclude: pyspedas|docs/source | ||
| # args: [--write-changes] | ||
|
|
||
| - repo: https://github.com/python-jsonschema/check-jsonschema | ||
| rev: 0.35.0 | ||
| hooks: | ||
| - id: check-github-workflows | ||
|
|
||
| - repo: https://github.com/abravalheri/validate-pyproject | ||
| rev: v0.24.1 | ||
| hooks: | ||
| - id: validate-pyproject | ||
| name: validate pyproject.toml | ||
| additional_dependencies: ['validate-pyproject-schema-store[all]'] | ||
|
|
||
| # - repo: https://github.com/tox-dev/pyproject-fmt | ||
| # rev: v2.11.1 | ||
| # hooks: | ||
| # - id: pyproject-fmt | ||
| # name: format pyproject.toml | ||
|
|
||
| # - repo: https://github.com/hukkin/mdformat | ||
| # rev: 1.0.0 | ||
| # hooks: | ||
| # - id: mdformat | ||
| # name: format .md files | ||
| # additional_dependencies: | ||
| # - mdformat-footnote | ||
| # - mdformat-gfm | ||
| # - mdformat-gfm-alerts | ||
| # - mdformat-ruff | ||
|
Comment on lines
+89
to
+98
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,5 +167,14 @@ ignore = [ | |
| "E501", # Ignore line too long | ||
| ] | ||
|
|
||
| [tool.codespell] | ||
| skip = "*.png,*.jpg,*.jpeg,*cache*,*egg*,.git,.hypothesis,.idea,.nox,.tox,_build,venv,*.lock" | ||
| # Add false positives found by codespell to ignore-words-list | ||
| ignore-words-list = """ | ||
| fo, | ||
| inout, | ||
| tha, | ||
| thi""" | ||
|
Comment on lines
+173
to
+177
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just a subset of the possible misspellings that codespell is finding. |
||
|
|
||
| [tool.pylint] | ||
| disable = ["line-too-long", "too-many-arguments",] | ||
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.
This hook would impose a particular opinionated style for
pyproject.toml. It does help keep the file organized, but this one is fine to skip if you don't like the style.