|
10 | 10 | # |
11 | 11 | repos: |
12 | 12 | # Autoformat: Python code |
13 | | - - repo: https://github.com/ambv/black |
14 | | - rev: 23.1.0 |
| 13 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 14 | + rev: f0fe93c067104b76ffb58852abe79673a8429bd1 # frozen: v0.11.8 |
15 | 15 | hooks: |
16 | | - - id: black |
| 16 | + - id: ruff |
| 17 | + args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"] |
| 18 | + - id: ruff-format |
17 | 19 |
|
18 | 20 | # Autoformat: markdown, yaml |
19 | 21 | - repo: https://github.com/pre-commit/mirrors-prettier |
20 | | - rev: v3.0.0-alpha.4 |
| 22 | + rev: 787fb9f542b140ba0b2aced38e6a3e68021647a3 # frozen: v3.5.3 |
21 | 23 | hooks: |
22 | 24 | - id: prettier |
23 | 25 | exclude: tests/.* |
24 | 26 |
|
25 | | - # Autoformat: https://github.com/asottile/reorder_python_imports |
26 | | - - repo: https://github.com/asottile/reorder_python_imports |
27 | | - rev: v3.9.0 |
28 | | - hooks: |
29 | | - - id: reorder-python-imports |
30 | | - |
31 | 27 | # Misc... |
32 | 28 | - repo: https://github.com/pre-commit/pre-commit-hooks |
33 | | - rev: v4.4.0 |
| 29 | + rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0 |
34 | 30 | # ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available |
35 | 31 | hooks: |
36 | | - # Autoformat: Makes sure files end in a newline and only a newline. |
37 | | - - id: end-of-file-fixer |
38 | | - exclude: tests/.* |
39 | | - |
40 | | - # Autoformat: Sorts entries in requirements.txt. |
41 | | - - id: requirements-txt-fixer |
42 | | - |
43 | | - # Lint: Check for files with names that would conflict on a |
44 | | - # case-insensitive filesystem like MacOS HFS+ or Windows FAT. |
| 32 | + # Sanity checks |
| 33 | + - id: check-added-large-files |
45 | 34 | - id: check-case-conflict |
46 | | - |
47 | | - # Lint: Checks that non-binary executables have a proper shebang. |
48 | 35 | - id: check-executables-have-shebangs |
| 36 | + - id: check-illegal-windows-names |
| 37 | + - id: check-merge-conflict |
49 | 38 |
|
50 | | - # Lint: Python code |
51 | | - - repo: https://github.com/pycqa/flake8 |
52 | | - rev: "6.0.0" |
53 | | - hooks: |
54 | | - - id: flake8 |
| 39 | + # Checks based on file type |
| 40 | + - id: check-toml |
| 41 | + - id: check-yaml |
| 42 | + |
| 43 | + # Detect mistakes |
| 44 | + - id: debug-statements |
| 45 | + - id: detect-private-key |
| 46 | + - id: forbid-submodules |
| 47 | + |
| 48 | + # Automatic fixes |
| 49 | + - id: mixed-line-ending |
| 50 | + args: [--fix=lf] |
| 51 | + - id: trailing-whitespace |
| 52 | + - id: requirements-txt-fixer |
| 53 | + - id: end-of-file-fixer |
| 54 | + exclude: tests/.* |
0 commit comments