-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from nsidc/adopt-pre-commit-ruff
Adopt pre commit and Ruff
- Loading branch information
Showing
17 changed files
with
327 additions
and
452 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
ci: | ||
# Don't push commits on to PRs. If you want this, it can be triggered with a | ||
# comment in a PR with text "pre-commit.ci autofix" | ||
autofix_prs: false | ||
|
||
repos: | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: "23.9.1" | ||
hooks: | ||
# With notebook support: | ||
# - id: black-jupyter | ||
- id: black | ||
|
||
- repo: https://github.com/asottile/blacken-docs | ||
rev: "1.16.0" | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==23.9.1] | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v4.4.0" | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: check-yaml | ||
- id: debug-statements | ||
# - id: end-of-file-fixer | ||
# - id: mixed-line-ending | ||
- id: name-tests-test | ||
args: ["--pytest-test-first"] | ||
# - id: trailing-whitespace | ||
|
||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: "v1.10.0" | ||
hooks: | ||
- id: rst-backticks | ||
- id: rst-directive-colons | ||
- id: rst-inline-touching-normal | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.0.291" | ||
hooks: | ||
- id: ruff | ||
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"] | ||
|
||
# Does it make sense to run MyPy with pre-commit? I thought I'd seen the | ||
# authors advise against. | ||
# - repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: "v1.5.1" | ||
# hooks: | ||
# - id: mypy | ||
# files: src|tests | ||
# args: [] | ||
# additional_dependencies: | ||
# - pytest | ||
|
||
# TODO: Configure in pyproject.toml | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: "v2.2.5" | ||
hooks: | ||
- id: codespell | ||
exclude: "^.*\\.bin$|^.*\\.ipynb$|^.*json" | ||
|
||
# TODO: ENABLE SHELLCHECK! | ||
# - repo: https://github.com/shellcheck-py/shellcheck-py | ||
# rev: "v0.9.0.5" | ||
# hooks: | ||
# - id: shellcheck |
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.