|
| 1 | +repos: |
| 2 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 3 | + rev: v5.0.0 |
| 4 | + hooks: |
| 5 | + - id: check-added-large-files |
| 6 | + name: Check for added large files |
| 7 | + - id: check-ast |
| 8 | + name: Check Python files for parse errors |
| 9 | + - id: check-case-conflict |
| 10 | + name: Check files for case conflicts on case-insensitive filesystems |
| 11 | + - id: check-docstring-first |
| 12 | + name: Check that no code is placed prior to docstrings |
| 13 | + - id: check-merge-conflict |
| 14 | + name: Check for files that contain merge conflict strings |
| 15 | + - id: check-toml |
| 16 | + name: Check valid TOML syntax |
| 17 | + - id: check-yaml |
| 18 | + name: Check valid YAML syntax |
| 19 | + - id: end-of-file-fixer |
| 20 | + name: Check for newline at end of file |
| 21 | + exclude: '^LICENSE$' |
| 22 | + - id: debug-statements |
| 23 | + name: Check for debugger imports |
| 24 | + - id: trailing-whitespace |
| 25 | + name: Check for trailing whitespaces |
| 26 | + - repo: https://github.com/PyCQA/bandit |
| 27 | + rev: 1.8.3 |
| 28 | + hooks: |
| 29 | + - id: bandit |
| 30 | + name: Run bandit (security linter for python) |
| 31 | + args: ["-c", "pyproject.toml", "-r", "-ll", "src/fourc_webviewer/", "tests/"] |
| 32 | + additional_dependencies: ["bandit[toml]"] |
| 33 | + - repo: https://github.com/PyCQA/docformatter |
| 34 | + rev: "eb1df347edd128b30cd3368dddc3aa65edcfac38" # change back to version once bug is fixed in latest version to be compatible with pre-commit |
| 35 | + hooks: |
| 36 | + - id: docformatter |
| 37 | + name: Run docformatter (formatter for docstrings) |
| 38 | + args: ["--in-place", "--config=./pyproject.toml", "-r", "src/fourc_webviewer/", "test/"] |
| 39 | + - repo: https://github.com/econchick/interrogate |
| 40 | + rev: 1.7.0 |
| 41 | + hooks: |
| 42 | + - id: interrogate |
| 43 | + name: Run interrogate (linter for docstrings) |
| 44 | + args: [--fail-under=100, --ignore-init-module, --style=google, -vv] |
| 45 | + - repo: https://github.com/pre-commit/mirrors-mypy |
| 46 | + rev: v1.15.0 |
| 47 | + hooks: |
| 48 | + - id: mypy |
| 49 | + name: Run mypy (static type checker for python) |
| 50 | + args: ["--install-types", "--non-interactive", "--ignore-missing-imports", "--follow-imports=silent"] |
| 51 | + - repo: https://github.com/asmeurer/removestar |
| 52 | + rev: "1.5.2" |
| 53 | + hooks: |
| 54 | + - id: removestar |
| 55 | + name: Run removestar (remove wildcard imports) |
| 56 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 57 | + rev: v0.11.1 |
| 58 | + hooks: |
| 59 | + - id: ruff # linter |
| 60 | + name: Run ruff (linter for Python) |
| 61 | + args: ["--fix", "--select", "I,TID252"] # "I => sort imports, TID252 => ban relative imports |
| 62 | + - id: ruff-format # formatter |
| 63 | + name: Run ruff (formatter for Python) |
| 64 | + - repo: https://github.com/crate-ci/typos |
| 65 | + rev: v1.30.2 |
| 66 | + hooks: |
| 67 | + - id: typos |
| 68 | + name: Run typo checker |
| 69 | + - repo: https://github.com/google/yamlfmt |
| 70 | + rev: v0.16.0 |
| 71 | + hooks: |
| 72 | + - id: yamlfmt |
| 73 | + name: Run yamlfmt |
| 74 | + args: ["-formatter", "retain_line_breaks_single=true"] |
0 commit comments