Skip to content

build: Modernize lint and CI tooling - #210

Merged
joshuarli merged 1 commit into
mainfrom
build/modernize-lint-ci-tooling
Nov 13, 2026
Merged

joshuarli merged 1 commit into
mainfrom
build/modernize-lint-ci-tooling

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Builds on #209 (pre-commit → prek).

  • Python lint: ruff v0.17.5 (ruff-check --fix and ruff-format) replaces reorder-python-imports, add-trailing-comma, pyupgrade, autopep8 and flake8. The pyproject.toml config keeps the current style: single quotes, force-single-line imports sorted case-insensitively, the required from __future__ import annotations, 120-column lines, and UP, T10 (instead of debug-statements) and Q (instead of double-quote-string-fixer). target-version = "py311" matches both packages' requires-python = ">=3.11". The old --py312-plus could have produced syntax that breaks on 3.11. .flake8 is gone. The Python changes are ruff's autofixes and formatting.
  • Generic hooks: these moved to prek's builtin repo with the same excludes and args. prek has no name-tests-test, so that hook stays on pre-commit-hooks v6.0.0.
  • Shell: scripts/bump-version.sh is now POSIX sh, and craft calls it with sh. It still takes craft's old and new versions as $1/$2. perl now reads the version from an env var instead of having it pasted into its code. A new shellcheck hook runs with --shell=sh --enable=check-extra-masked-returns. It skips .envrc, which direnv runs with bash.
  • uv: 0.13.5 → 0.13.8 in devenv/config.ini (sha256 values from the release's .sha256 files) and in the setup-uv steps.
  • Actions: actions/checkout is now v7.0.1 everywhere (it was a mix of v3, v4 and v5). astral-sh/setup-uv is v10.3.3 and dorny/paths-filter is v4.0.2. Every action is pinned by SHA with an exact # vX.Y.Z comment. The upstream breaking changes (node24, setup-uv cache defaults, checkout v7 refusing fork checkouts on pull_request_target/workflow_run) don't affect these workflows.

Open questions:

  • COM rules are not enabled, because COM812 conflicts with ruff-format. ruff-format also doesn't hug a lone dict argument like json.dumps({...}) (that's preview-only), which causes most of the churn in tests/gen_stubs_test.py.
  • ruff skips the generated sentry-options/sentry_options/__init__.pyi, since the gen-stubs hook owns it and the two would fight. It also skips *.md so docs code samples stay as written. The old hooks touched neither.
  • shellcheck-py is pinned to v0.11.0.1-1, its newest tag. It has the same shellcheck 0.11.0 as v0.11.0.1.
  • dorny/paths-filter v4.0.3 exists and has a security fix for list-files shell/csv output. We only use json, so this stays on v4.0.2. Bump it if you'd rather be on latest.
  • release.yml jumps checkout from v3 to v7. PR CI doesn't run that workflow, so the next release is its first real test.

via @joshuarli.

--

View Session [Sentry]

Replace the Python lint hooks with ruff, move the generic hooks to prek
builtins, port bump-version.sh to POSIX sh with a shellcheck hook, bump
uv to 0.13.8, and bump and fully pin the GitHub Actions.
@joshuarli
joshuarli marked this pull request as ready for review November 13, 2026 21:17
@sentry-junior
sentry-junior Bot requested a review from joshuarli November 13, 2026 21:17
@joshuarli
joshuarli merged commit 2924e6b into main Nov 13, 2026
27 checks passed
@joshuarli
joshuarli deleted the build/modernize-lint-ci-tooling branch November 13, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant