8000 Enforce the 99-character line length (hardening 3b) by rafatahmed · Pull Request #121 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

Enforce the 99-character line length (hardening 3b) - #121

Merged
rafatahmed merged 1 commit into
mainfrom
style/line-length
Oct 23, 2026
Merged

rafatahmed merged 1 commit into
mainfrom
style/line-length

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

Hardening 3b, following #120: every line now fits in 99 columns, and the CI style job enforces it.

What changed

  • Messages: 342 long messages are split into adjacent string literals inside brackets. Python joins adjacent literals when it compiles the file, so the text is identical.
  • Comments and docstrings: long comment lines and docstring lines are rewrapped.
  • Formatting: ruff format lays the pieces out.
  • Hand edits: three places were rewrapped by hand, with the same behaviour:
    • mix_cli shortens the terminal reason line in two steps instead of one long f-string;
    • a benchmark input path is joined in two parts;
    • the verify_distribution smoke script is rewrapped.
  • Text written out unchanged: report and sheet CSS, the benchmark Markdown page, the welcome screen and the docs GitHub icon keep their long lines. Each of those strings carries one # noqa: E501 on its closing line, because wrapping would change what FlahaX writes (9 strings in total).
  • Settings: pyproject.toml no longer ignores E501.
  • Docs: CONTRIBUTING explains the rule, and API_REFERENCE.md is regenerated for the two docstring summaries that now wrap.

Evidence that nothing changed

  • Syntax trees: all 163 Python files have the same syntax tree as main, apart from docstring line breaks. The only files that differ are the three hand edits above.
  • Behaviour baseline: the 97 results (26 formulas × 2 waters through run_batch, plus the batch and session sweeps) are identical to main.
  • Tests: 539 pass, including the PHREEQC tests.
  • Package check: tools/verify_distribution.py passes (isolated wheel and sdist).
  • Docs: the strict Sphinx build (-W --keep-going) passes.
  • Style: ruff check . and ruff format --check . pass.
  • Guards: the Python 3.11 syntax test and the file-header test pass.
  • Line endings: every file uses LF.

Long messages are split into adjacent string literals inside brackets,
long comments and docstring lines are rewrapped, and ruff format lays
them out. Every Python file keeps the same syntax tree as before apart
from docstring line breaks, except three hand edits that keep their
behaviour: the terminal reason line in mix_cli, a benchmark input path
joined in two parts, and the rewrapped verify_distribution smoke script.

Text FlahaX writes out unchanged (report and sheet CSS, the benchmark
Markdown page, the welcome screen, the docs GitHub icon) keeps its long
lines with one `# noqa: E501` on the closing line of that string.

E501 is no longer ignored, so the CI style job enforces 99 columns.
CONTRIBUTING explains the rule; API_REFERENCE.md is regenerated for
the two rewrapped docstring summaries.
@rafatahmed rafatahmed self-assigned this Oct 23, 2026
@rafatahmed
rafatahmed merged commit 131d750 into main Oct 23, 2026
8 checks passed
@rafatahmed
rafatahmed deleted the style/line-length branch October 23, 2026 11:47
rafatahmed added a commit that referenced this pull request Nov 7, 2026
Enforce the 99-character line length (hardening 3b)
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

0