Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: pre-commit

on:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: actions/setup-python@v6

- uses: pre-commit/action@v3.0.1
with:
# only run on files changed in this PR
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
11 changes: 0 additions & 11 deletions .github/workflows/ruff.yml

This file was deleted.

17 changes: 8 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_stages: [ pre-commit, pre-push ]
exclude: ^src/(bin/|web_interface/static/package-lock.json)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v6.0.0
hooks:
- id: check-added-large-files
args: [ --maxkb=10000 ]
Expand Down Expand Up @@ -30,30 +30,29 @@ repos:
exclude: ^src/web_interface/static/package-lock.json

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
rev: 3.0.0
hooks:
- id: shellcheck

- repo: https://github.com/pryorda/dockerfilelint-precommit-hooks
rev: v0.1.0
- repo: https://github.com/hadolint/hadolint
rev: v2.14.0
hooks:
- id: dockerfilelint
- id: hadolint

- repo: https://github.com/pre-commit/mirrors-jshint
rev: v2.13.0
rev: v2.13.6
hooks:
- id: jshint

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.2.2'
rev: 'v0.14.11'
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-format

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
rev: v0.44.0
hooks:
- id: markdownlint
args: [ "--config", ".markdownlint.yaml" ]

39 changes: 24 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,20 @@ exclude = [
"src/plugins/analysis/input_vectors/internal", # FixMe: runs inside a bionic docker container with python 3.6
]
line-length = 120
target-version = "py38"
target-version = "py310"

[tool.ruff.lint]
select = [
"F", # Pyflakes
"E", # pycodestyle Error
"W", # pycodestyle Warning
"C90", # mccabe
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
# see https://docs.astral.sh/ruff/rules
"ERA", # eradicate
"YTT", # flake8-2020
"ANN", # flake8-annotations
"S", # flake8-bandit (security)
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"EXE", # flake8-executable
"FIX", # flake8-fixme
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"PIE", # flake8-pie
Expand All @@ -49,26 +48,36 @@ select = [
"Q", # flake8-quotes
"RET", # flake8-return
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TC", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PL", # Pylint
"I", # isort
"C90", # mccabe
"N", # pep8-naming
"PERF", # Perflint
"E", # pycodestyle Error
"W", # pycodestyle Warning
"F", # Pyflakes
"PLC", # Pylint
"PLE", # Pylint Error
"PLR", # Pylint Refactor
"PLW", # Pylint Warning
"UP", # pyupgrade
"FURB", # refurb (FURB code optimzations)
"RUF", # Ruff-specific rules
]
ignore = [
"A003",
"ANN204", # type annotation for special methods (e.g. __init__)
"PERF203",
"PERF401",
"RUF001",
"RUF002",
"RUF003",
"RUF015",
# pydantic only supports these from python>=3.9
"UP006",
"UP007",
# rules may cause conflicts when used with the formatter
"FIX001", # line contains fixme
"FIX004", # line contains hack
# rules may cause conflicts when used with the formatter:
"ISC001",
"Q001",
]
Expand Down
Loading