diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ae0422..41c32fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,15 @@ env: UV_FROZEN: 1 jobs: + prek: + runs-on: ubuntu-24.04 + env: + SKIP: 'no-commit-to-branch' + + steps: + - uses: actions/checkout@v7 + - uses: j178/prek-action@v2 + test: name: Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} runs-on: ${{ matrix.runs-on }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c5038ab..e3bf569 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,35 +1,38 @@ -ci: - autofix_prs: false - autoupdate_schedule: quarterly - autoupdate_commit_msg: "chore: update pre-commit hooks" - repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: "v6.0.0" hooks: + - id: no-commit-to-branch + - id: check-merge-conflict + - id: check-yaml - id: check-added-large-files exclude: uv.lock - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.14.1" + rev: "v0.16.0" hooks: - id: ruff args: ["--fix", "--exit-non-zero-on-fix", "--show-fixes"] - id: ruff-format + - repo: https://github.com/astral-sh/ty-pre-commit + rev: v0.0.63 + hooks: + - id: ty + - repo: https://github.com/python-jsonschema/check-jsonschema - rev: "0.34.1" + rev: "0.37.4" hooks: - id: check-github-workflows - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.15.0 + rev: v2.16.0 hooks: - id: pretty-format-yaml args: [--autofix, --offset, '2', --preserve-quotes] - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.9.4 + rev: 0.11.31 hooks: # Check and update the uv lockfile - id: uv-lock diff --git a/pyproject.toml b/pyproject.toml index 99f169f..8885eac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,6 @@ testpaths = [ "tests", ] - [tool.coverage] run.source = ["harmonwig"] report.exclude_also = [ @@ -64,34 +63,5 @@ report.exclude_also = [ [tool.ruff] src = ["src"] -[tool.ruff.lint] -extend-select = [ - "B", # flake8-bugbear - "I", # isort - "ARG", # flake8-unused-arguments - "C4", # flake8-comprehensions - "EM", # flake8-errmsg - "ICN", # flake8-import-conventions - "G", # flake8-logging-format - "PGH", # pygrep-hooks - "PIE", # flake8-pie - "PL", # pylint - "PT", # flake8-pytest-style - "PTH", # flake8-use-pathlib - "RET", # flake8-return - "RUF", # Ruff-specific - "SIM", # flake8-simplify - "UP", # pyupgrade - "YTT", # flake8-2020 - "EXE", # flake8-executable - "NPY", # NumPy specific rules -] -ignore = [ - "PLR09", # Too many <...> - "PLR2004", # Magic value used in comparison - "PLC0415", # `import` should be at the top-level of a file - "ISC001", # Conflicts with formatter -] - [tool.uv] required-version = ">=0.9.0"