Skip to content

chore: consolidate tool config and repair pre-commit hooks - #143

Open
CuriousLearner wants to merge 1 commit into
masterfrom
chore/fix-tooling-config
Open

chore: consolidate tool config and repair pre-commit hooks#143
CuriousLearner wants to merge 1 commit into
masterfrom
chore/fix-tooling-config

Conversation

@CuriousLearner

Copy link
Copy Markdown
Owner

Summary

ruff.toml and the [tool.ruff] sections in pyproject.toml declared byte-identical settings. Ruff reads ruff.toml first, so the pyproject.toml block was dead config that would have silently diverged. Delete ruff.toml and keep the settings in pyproject.toml, alongside the pytest and coverage config that already lives there.

.pre-commit-config.yaml could not run at all. It fetched hooks over the git:// protocol, which GitHub disabled in 2022, pinned ambv/black at a stable tag that no longer exists, listed a ruff hook under a repository that does not provide one, and set language_version: python3.7, below the project's supported floor. It is rewritten to use HTTPS, the official astral-sh/ruff-pre-commit, and a small set of basic hooks. Black is dropped: it formats at 88 columns while ruff is configured at 120, and CI only enforces ruff. The ruff hook is pinned to the same version as requirements/testing.txt so the hook and CI cannot drift. Two files carried a stray blank line at end of file and are fixed so the new hooks pass on a clean checkout.

docs/conf.py passed sphinx_rtd_theme options to sphinx_book_theme, which emitted an unsupported-option warning for each on every build. The two options that did not warn resolve to values identical to the theme's own defaults, so removing the block changes nothing about rendering. The version fallback used when the package import fails was two releases stale. A section heading in docs/configuration.rst had an underline shorter than its title.

Verified against a docs build: 5 warnings before, none after. The Framework :: Django :: 2.0 classifier is removed, since the dependency floor is django>=2.1.5 and the lowest tested environment is Django 2.2.

Test plan

  • Captured ruff check --show-settings before and after deleting ruff.toml. The only difference is the reported settings path; line length, exclude list, rule selection, and isort configuration are byte-identical.
  • Docs built in a clean environment with docs/requirements.txt: zero warnings.
  • Both pre-commit revisions confirmed to exist upstream.
  • Full suite: 144 passed. Ruff clean.

Remove ruff.toml and keep the equivalent [tool.ruff] sections in
pyproject.toml so ruff, pytest and coverage config all live in one file.
The two declared byte-identical settings; ruff resolves the same
configuration after the change.

Rewrite .pre-commit-config.yaml, which could not run at all. It used the
git:// protocol GitHub disabled in 2022, referenced a ruff hook that the
pre-commit-hooks repo does not provide, pinned black at a rev that no
longer exists under an org that no longer hosts it, and requested a
Python version below requires-python. The replacement uses https URLs,
current revs, and the official astral-sh/ruff-pre-commit hook. Black is
dropped because it formats at 88 columns while ruff is configured at 120
and CI enforces only ruff.

Drop the sphinx_rtd_theme options from docs/conf.py, which the configured
sphinx_book_theme does not accept, refresh the stale version fallback,
and extend a short RST heading underline. The docs now build without
warnings.

Remove the Framework :: Django :: 2.0 classifier, which is below the
declared django>=2.1.5 floor.
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