8000 Hardening 3a/4: PEP 8 formatting, file headers, CI style check by rafatahmed · Pull Request #120 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

Hardening 3a/4: PEP 8 formatting, file headers, CI style check - #120

Merged
rafatahmed merged 1 commit into
mainfrom
style/pep8-headers
Oct 23, 2026
Merged

rafatahmed merged 1 commit into
mainfrom
style/pep8-headers

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

Third hardening PR, part a. Owner decisions 2026-10-23: PEP 8 at line length 99; the file-header template.

What changes

  • Formatting: all Python code formatted with ruff format (PEP 8, 99 columns, existing quote style kept). It changes layout only, never meaning: one statement per line, PEP 8 spacing, blank lines and wrapping.
  • File headers (161 files), PEP 8 order: shebang only on the 25 runnable tools and examples; SPDX copyright and license lines; the disclaimer; then the module docstring (36 test files gained an accurate one); then imports. No encoding lines.
  • flahax/__init__.py: one __all__ list (135 names, identical) and __version__ before the imports, replacing 13 __all__ += lines scattered between them; import order kept.
  • Lint fixes: unused imports and variables removed (one was an unused H3PO4 term in the phosphate loop: H3PO4 is still counted in the mass balance, p_factor); two lambdas assigned to names became functions; the ambiguous name l became line (checked with the tokenizer: only the 44 variable uses changed, no string or comment).
  • Enforcement: settings in pyproject.toml (ruff is a development tool, not a runtime dependency); a new CI style job runs ruff check and ruff format --check with ruff 0.8.4 pinned; tests/test_file_headers.py checks every header and the dunder order; CONTRIBUTING.md documents the conventions.

Not yet

Line length (E501) is not enforced yet: 438 long strings, docstrings and comments are rewrapped by hand in 3b, which then turns the check on.

Proof it changes nothing

  • The public API is identical (same 135 names).
  • The 97-result baseline (26 recipes, 52 complete batches, 19 farmer sessions) is identical.
  • 538 tests pass with live PHREEQC required; tools/verify_distribution.py PASS; strict docs build; no Python 3.12-only syntax; LF.

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 Flahax | 🛠️ Build #35352803 | 📁 Comparing 2439082 against latest (ff675b2)

  🔍 Preview build  

1 file changed
± changelog.html

@rafatahmed
rafatahmed merged commit bc656f6 into main Oct 23, 2026
8 checks passed
@rafatahmed
rafatahmed deleted the style/pep8-headers branch October 23, 2026 11:31
@rafatahmed rafatahmed self-assigned this Oct 23, 2026
rafatahmed added a commit that referenced this pull request Nov 7, 2026
Hardening 3a/4: PEP 8 formatting, file headers, CI style check
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