Skip to content

Commit

Permalink
chore: add pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Dec 10, 2023
1 parent 5912c52 commit 8c33642
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,99 @@
ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"

exclude: |
(?x)^(
docs/index.md|
docs/api/antarctic_plots.rst|
docs/api/antarctic_plots.fetch.rst|
docs/api/antarctic_plots.maps.rst|
docs/api/antarctic_plots.profile.rst|
docs/api/antarctic_plots.regions.rst|
docs/api/antarctic_plots.utils.rst|
CHANGELOG.md|
.github/ISSUE_TEMPLATE/bug_report.md|
)$
repos:
# - repo: https://github.com/psf/black-pre-commit-mirror
# rev: "23.9.1"
# hooks:
# - id: black-jupyter

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.7.0]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.6"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.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: requirements-txt-fixer
- 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/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
args: [--prose-wrap=always]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.7.1"
hooks:
- id: mypy
files: src|tests
args: []
additional_dependencies:
- pytest
# - data-science-types

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
hooks:
- id: codespell
name: codespell
description: Checks for common misspellings in text files.
entry:
codespell --skip="*.js,*.html,*.css,*.svg,*.ipynb" -L ore
--ignore-regex=".*codespell-ignore$"

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.6"
hooks:
- id: shellcheck

# check for commonly miss-capitalized words
- repo: local
hooks:
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
exclude: .pre-commit-config.yaml

0 comments on commit 8c33642

Please sign in to comment.