From 9b1c50f5006678c3938be81c72a1ae9d8741b14c Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Fri, 24 Jul 2026 00:51:41 +0100 Subject: [PATCH 1/3] Bump ruff, add ty type checker --- .pre-commit-config.yaml | 13 +++++++++---- pyproject.toml | 30 ------------------------------ 2 files changed, 9 insertions(+), 34 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c5038ab..2fdd82c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,25 +11,30 @@ repos: 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" From 92ef8ed332202b6496e17542f4e928043cccc515 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Fri, 24 Jul 2026 00:59:38 +0100 Subject: [PATCH 2/3] Add prek to CI --- .github/workflows/ci.yml | 9 +++++++++ .pre-commit-config.yaml | 5 ----- 2 files changed, 9 insertions(+), 5 deletions(-) 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 2fdd82c..bed28a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,3 @@ -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" From c1f0caad3ad77324d49b0d82b3fe8d2cdbdced48 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Fri, 24 Jul 2026 01:03:32 +0100 Subject: [PATCH 3/3] Add more hooks --- .pre-commit-config.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bed28a6..e3bf569 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,6 +2,9 @@ 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