|
| 1 | +# This file contains 2 stages |
| 2 | +# pre-commit stage - runs by default pre-commit |
| 3 | +# manual stage - runs the same tools but modifies files |
| 4 | +# run as: pre-commit run --all-files --hook-stage manual |
| 5 | +repos: |
| 6 | + - repo: https://gitlab.cee.redhat.com/infosec-public/developer-workbench/tools.git |
| 7 | + rev: rh-pre-commit-2.3.0 |
| 8 | + hooks: |
| 9 | + # If you have not run this hook on your system before, it may prompt you to |
| 10 | + # log in for patterns, and you will need to try again. |
| 11 | + # |
| 12 | + # Docs: https://source.redhat.com/departments/it/it-information-security/leaktk/leaktk_components/rh_pre_commit |
| 13 | + - id: rh-pre-commit |
| 14 | + name: Red Hat pre-commit (check) |
| 15 | + # - id: rh-pre-commit.commit-msg # Optional for commit-msg attestation |
| 16 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 17 | + rev: v0.11.1 |
| 18 | + hooks: |
| 19 | + # Run the linter |
| 20 | + - id: ruff |
| 21 | + name: ruff (check) |
| 22 | + stages: [pre-commit] |
| 23 | + - id: ruff |
| 24 | + name: ruff (fix) |
| 25 | + args: [--fix] |
| 26 | + stages: [manual] |
| 27 | + # Run the formatter |
| 28 | + - id: ruff-format |
| 29 | + name: ruff format (check) |
| 30 | + args: [--check] |
| 31 | + stages: [pre-commit] |
| 32 | + - id: ruff-format |
| 33 | + name: ruff format (fix) |
| 34 | + stages: [manual] |
| 35 | + - repo: https://github.com/PyCQA/autoflake |
| 36 | + rev: v2.2.1 |
| 37 | + hooks: |
| 38 | + - id: autoflake |
| 39 | + name: autoflake (check) |
| 40 | + args: [--check, --remove-all-unused-imports] |
| 41 | + stages: [pre-commit] |
| 42 | + - id: autoflake |
| 43 | + name: autoflake (fix) |
| 44 | + args: [--in-place, --remove-all-unused-imports] |
| 45 | + stages: [manual] |
| 46 | + - repo: https://github.com/psf/black |
| 47 | + rev: 25.1.0 |
| 48 | + hooks: |
| 49 | + - id: black |
| 50 | + name: black (check) |
| 51 | + args: [--check] |
| 52 | + stages: [pre-commit] |
| 53 | + - id: black |
| 54 | + name: black (fix) |
| 55 | + stages: [manual] |
| 56 | + # TODO: Switch back to a regular release docformatter |
| 57 | + # after https://github.com/PyCQA/docformatter/issues/289 fix is released |
| 58 | + - repo: https://github.com/PyCQA/docformatter |
| 59 | + rev: eb1df347edd128b30cd3368dddc3aa65edcfac38 |
| 60 | + hooks: |
| 61 | + - id: docformatter |
| 62 | + name: docformatter (check) |
| 63 | + additional_dependencies: [tomli] |
| 64 | + args: [--check, --config, ./pyproject.toml] |
| 65 | + stages: [pre-commit] |
| 66 | + - id: docformatter |
| 67 | + name: docformatter (fix) |
| 68 | + additional_dependencies: [tomli] |
| 69 | + args: [--in-place, --config, ./pyproject.toml] |
| 70 | + stages: [manual] |
| 71 | + - repo: https://github.com/pycqa/isort |
| 72 | + rev: 6.0.1 |
| 73 | + hooks: |
| 74 | + - id: isort |
| 75 | + name: isort (check) |
| 76 | + args: [--check-only] |
| 77 | + stages: [pre-commit] |
| 78 | + - id: isort |
| 79 | + name: isort (fix) |
| 80 | + stages: [manual] |
0 commit comments