style: lint and format src/djehuty/web/formatter.py with ruff, enforce - #180
Draft
641e16 wants to merge 9 commits into
Draft
style: lint and format src/djehuty/web/formatter.py with ruff, enforce#180641e16 wants to merge 9 commits into
641e16 wants to merge 9 commits into
Conversation
* pyproject.toml: Add [tool.ruff] config (line-length 100; E, W, F, I, N, B rule sets) and a "lint" dependency group with ruff, so CI and local runs use the same version. * uv.lock: Lock ruff 0.15.21; refresh stale djehuty version (26.3.1 -> 26.3.3).
* justfile: add lint paths to enforce scope and add lint recipe
* constants.py, convenience.py, rdf.py: Apply "ruff check --fix" (import sorting, not-in comparison) and "ruff format"; wrap remaining long lines. no functional changes.
* .github/workflows/lint.yml: Add reusable workflow that runs "just lint" (ruff check + format check) via uv. * .github/workflows/ci.yml: Wire in the lint job, running in parallel with build and unit tests for fast feedback.
* justfile: ruff lives in the "lint" dependency group, not "dev", so "uv run --group dev ruff" fails on a fresh environment like CI.
* README.md: Add Linting section describing the incremental rollout and the just lint recipe. * CONTRIBUTING.md: State the enforced line length (100) and add a lint step to the code conventions.
* formatter.py: Mechanical pass only ("ruff check --fix" and
"ruff format"). No functional changes; the remaining four long
lines are resolved in the next commit.
* formatter.py: Wrap four over-long URL f-strings. * justfile: Add src/djehuty/web/formatter.py to lint_paths.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #180 +/- ##
=======================================
Coverage 17.49% 17.49%
=======================================
Files 21 21
Lines 10217 10217
Branches 1977 1977
=======================================
Hits 1787 1787
Misses 8241 8241
Partials 189 189 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Next slice of the incremental Ruff rollout (#66): lints and formats
src/djehuty/web/formatter.pyand adds it to the enforced scope. Split into a mechanical commit (pureruff check --fix+ruff formatoutput, safe to skim) and a manual commit (the four violations ruff could not auto-fix, worth review). The issue offered separate PRs if the diff ran large; the manual remainder is four wrapped lines, so one PR with two commits.Changes
src/djehuty/web/formatter.py(commit 1, mechanical): applyruff check --fix(import sorting) andruff format. No functional changes.src/djehuty/web/formatter.py(commit 2, manual): wrap four over-long URL f-strings via implicit concatenation; the resulting strings are byte-identical.justfile: add the file tolint_pathssojust lintand CI enforce it.Approval Checklist
Issue Reference
Closes #145 (part of #66)
Screenshots
Green CI run on my fork with the Lint job covering the extended scope:
https://github.com/641e16/djehuty/actions/runs/29340878477
Notes
just lintgreen on the full scope; unit tests 157/157.