Skip to content

chore: fix broken pre-commit hooks#60

Merged
semarj merged 5 commits intoShipEngine:mainfrom
micaelaw:chore/fix-pre-commit-hooks
Apr 23, 2026
Merged

chore: fix broken pre-commit hooks#60
semarj merged 5 commits intoShipEngine:mainfrom
micaelaw:chore/fix-pre-commit-hooks

Conversation

@micaelaw
Copy link
Copy Markdown
Contributor

The pre-commit hooks are still silently broken:

  • black 20.8b1 crashes against modern click (ImportError: _unicodefun)
  • flake8 3.9.2 crashes on Python 3.12 (EntryPoints.get removed)

Bumped both (plus their plugins) to current versions, then applied the resulting black 24 reformat and fixed the 30 flake8 errors that surfaced.

Also updated pyproject.toml's dev-deps to match, so poetry run black/flake8 and editor integrations don't drift from what pre-commit enforces. poetry.lock only picks up the expected transitive bumps (packaging, pycodestyle, pyflakes, typing-extensions).

All hooks green, 36/36 tests pass.

black 20.8b1 was broken against click>=8.1 (ImportError: _unicodefun),
and flake8 3.9.2 was broken on Python 3.12 (EntryPoints.get removed).
Bumps black, flake8, their transitive plugins, and blacken-docs to
currently-maintained versions.
Modern black does not recognize 'safe' as a pyproject config key and
emits "Invalid config keys detected: 'safe'" on every run. --safe is
still the default CLI behavior, so removing the key is a no-op for
actual formatting.
Applies black 24.10.0 formatting to the repo (mostly trailing-comma
and blank-line-after-module-docstring changes from 4 years of black
style evolution) and fixes the 29 E501 line-length errors plus 1 D419
empty-docstring that the upgraded flake8 surfaced. Bundled together
because the formatting hook and the lint hook block each other in
intermediate states — keeping them in one commit avoids a red
midpoint in the series.
black ^22.0.0 -> ^24.0.0 and flake8 ^6.0.0 -> ^7.0.0 so that
'poetry run black' / 'poetry run flake8' (and editor integrations
using the poetry venv) produce the same output as the pre-commit
hooks. Regenerates poetry.lock; transitive bumps are scoped to
black/flake8 deps only (packaging, pycodestyle, pyflakes,
typing-extensions).
Keeps the pre-commit hook and the poetry dev-dep on the exact same
flake8 version so local and CI runs can't diverge.
@semarj semarj merged commit a34c72d into ShipEngine:main Apr 23, 2026
6 checks passed
@micaelaw micaelaw deleted the chore/fix-pre-commit-hooks branch April 23, 2026 19:27
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.

2 participants