|
| 1 | +# https://pre-commit.com/ |
| 2 | +# |
| 3 | +# Before first use: `pre-commit install` |
| 4 | +# To run: `pre-commit run --all-files` |
| 5 | +# To update: `pre-commit autoupdate` |
| 6 | +# - &flake8_dependencies below needs updated manually |
| 7 | +# |
| 8 | +# Be careful about linting that rewrites code syntax we want to test. |
| 9 | +ci: |
| 10 | + # See: https://pre-commit.ci/#configuration |
| 11 | + autofix_prs: false |
| 12 | + autoupdate_schedule: quarterly |
| 13 | + skip: [no-commit-to-branch] |
| 14 | +fail_fast: true |
| 15 | +default_language_version: |
| 16 | + python: python3 |
| 17 | +repos: |
| 18 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 19 | + rev: v4.4.0 |
| 20 | + hooks: |
| 21 | + - id: check-added-large-files |
| 22 | + - id: check-case-conflict |
| 23 | + - id: check-merge-conflict |
| 24 | + # - id: check-symlinks |
| 25 | + - id: check-ast |
| 26 | + - id: check-toml |
| 27 | + - id: check-yaml |
| 28 | + - id: debug-statements |
| 29 | + - id: end-of-file-fixer |
| 30 | + exclude_types: [svg] |
| 31 | + - id: mixed-line-ending |
| 32 | + - id: trailing-whitespace |
| 33 | + - id: name-tests-test |
| 34 | + args: ["--pytest-test-first"] |
| 35 | + - repo: https://github.com/abravalheri/validate-pyproject |
| 36 | + rev: v0.13 |
| 37 | + hooks: |
| 38 | + - id: validate-pyproject |
| 39 | + name: Validate pyproject.toml |
| 40 | + # I don't yet trust ruff to do what autoflake does |
| 41 | + - repo: https://github.com/PyCQA/autoflake |
| 42 | + rev: v2.1.1 |
| 43 | + hooks: |
| 44 | + - id: autoflake |
| 45 | + args: [--in-place] |
| 46 | + - repo: https://github.com/pycqa/isort |
| 47 | + rev: 5.12.0 |
| 48 | + hooks: |
| 49 | + - id: isort |
| 50 | + - repo: https://github.com/asottile/pyupgrade |
| 51 | + rev: v3.6.0 |
| 52 | + hooks: |
| 53 | + - id: pyupgrade |
| 54 | + args: [--py38-plus] |
| 55 | + - repo: https://github.com/psf/black |
| 56 | + rev: 23.3.0 |
| 57 | + hooks: |
| 58 | + - id: black |
| 59 | + # - id: black-jupyter |
| 60 | + # - repo: https://github.com/charliermarsh/ruff-pre-commit |
| 61 | + # rev: v0.0.272 |
| 62 | + # hooks: |
| 63 | + # - id: ruff |
| 64 | + # args: [--fix-only, --show-fixes] |
| 65 | + - repo: https://github.com/PyCQA/flake8 |
| 66 | + rev: 6.0.0 |
| 67 | + hooks: |
| 68 | + - id: flake8 |
| 69 | + additional_dependencies: &flake8_dependencies |
| 70 | + # These versions need updated manually |
| 71 | + - flake8==6.0.0 |
| 72 | + - flake8-comprehensions==3.12.0 |
| 73 | + - flake8-bugbear==23.6.5 |
| 74 | + - flake8-simplify==0.20.0 |
| 75 | + - repo: https://github.com/asottile/yesqa |
| 76 | + rev: v1.5.0 |
| 77 | + hooks: |
| 78 | + - id: yesqa |
| 79 | + additional_dependencies: *flake8_dependencies |
| 80 | + - repo: https://github.com/codespell-project/codespell |
| 81 | + rev: v2.2.4 |
| 82 | + hooks: |
| 83 | + - id: codespell |
| 84 | + types_or: [python, rst, markdown] |
| 85 | + additional_dependencies: [tomli] |
| 86 | + files: ^(innerscope|docs)/ |
| 87 | + - repo: https://github.com/charliermarsh/ruff-pre-commit |
| 88 | + rev: v0.0.272 |
| 89 | + hooks: |
| 90 | + - id: ruff |
| 91 | + # `pyroma` may help keep our package standards up to date if best practices change. |
| 92 | + # This is probably a "low value" check though and safe to remove if we want faster pre-commit. |
| 93 | + - repo: https://github.com/regebro/pyroma |
| 94 | + rev: "4.2" |
| 95 | + hooks: |
| 96 | + - id: pyroma |
| 97 | + args: [-n, "10", .] |
| 98 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 99 | + rev: v4.4.0 |
| 100 | + hooks: |
| 101 | + - id: no-commit-to-branch # no commit directly to main |
0 commit comments