|
| 1 | +# files: '^.*\.py|.*\.tpl|.*\.sql|.*\.yaml|.*\.txt|.*\.md$' |
| 2 | +exclude: '^.*\.xtf|.*\.xml|.*\.ili |
| 3 | +
|
| 4 | +repos: |
| 5 | + # Fix end of files |
| 6 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 7 | + rev: v4.6.0 |
| 8 | + hooks: |
| 9 | + - id: trailing-whitespace |
| 10 | + - id: end-of-file-fixer |
| 11 | + - id: mixed-line-ending |
| 12 | + args: |
| 13 | + - "--fix=lf" |
| 14 | +
|
| 15 | + # Remove unused imports/variables |
| 16 | + - repo: https://github.com/myint/autoflake |
| 17 | + rev: v2.3.1 |
| 18 | + hooks: |
| 19 | + - id: autoflake |
| 20 | + args: |
| 21 | + - "--in-place" |
| 22 | + - "--remove-all-unused-imports" |
| 23 | + - "--remove-unused-variable" |
| 24 | +
|
| 25 | + # Sort imports |
| 26 | + - repo: https://github.com/pycqa/isort |
| 27 | + rev: "5.13.2" |
| 28 | + hooks: |
| 29 | + - id: isort |
| 30 | + args: |
| 31 | + - --profile |
| 32 | + - black |
| 33 | +
|
| 34 | + # Black formatting |
| 35 | + - repo: https://github.com/psf/black |
| 36 | + rev: "24.4.2" |
| 37 | + hooks: |
| 38 | + - id: black |
| 39 | + args: ["--line-length=99"] |
| 40 | +
|
| 41 | + # tool to automatically upgrade syntax for newer versions of the language |
| 42 | + - repo: https://github.com/asottile/pyupgrade |
| 43 | + rev: v3.16.0 |
| 44 | + hooks: |
| 45 | + - id: pyupgrade |
| 46 | + args: [--py37-plus] |
| 47 | +
|
| 48 | + # Lint files |
| 49 | + - repo: https://github.com/pycqa/flake8 |
| 50 | + rev: "7.1.0" |
| 51 | + hooks: |
| 52 | + - id: flake8 |
| 53 | + args: [ |
| 54 | + "--max-line-length=115", |
| 55 | + # ignore long comments (E501), as long lines are formatted by black |
| 56 | + "--ignore=E501,E203,W503", |
| 57 | + ] |
| 58 | +
|
| 59 | +# # Static type-checking with mypy |
| 60 | +# - repo: https://github.com/pre-commit/mirrors-mypy |
| 61 | +# rev: 'v1.5.1' |
| 62 | +# hooks: |
| 63 | +# - id: mypy |
| 64 | +# additional_dependencies: [types-pytz, types-Deprecated, types-PyYAML, types-requests, types-tabulate, types-jsonschema, django-stubs] |
| 65 | +# pass_filenames: false |
| 66 | +# entry: bash -c 'mypy -p docker-qgis -p docker-app "$@"' -- |
| 67 | + |
| 68 | +ci: |
| 69 | + autofix_prs: true |
| 70 | + autoupdate_schedule: quarterly |
0 commit comments