Skip to content

chore: lint the whole repository — ruff check . in CI (#54) - #126

Merged
JohnnyWilson16 merged 1 commit into
mainfrom
chore/repo-wide-ruff-jwd
Jul 11, 2026
Merged

JohnnyWilson16 merged 1 commit into
mainfrom
chore/repo-wide-ruff-jwd

Conversation

@JohnnyWilson16

Copy link
Copy Markdown
Contributor

Summary

Closes #54. CI linted only src tests; ruff check . had 368 errors across benchmarks and notebooks. This PR takes it to zero and widens both CI lint steps (ci.yml + release.yml) to ruff check . so it stays there.

What was fixed vs. ignored (and why)

Fixed (code changes, no behavior change):

  • notebooks 06/08/09/10: import sorting + PLR0402 alias (ruff --fix; the ipynb rewrite also normalized cell ids and unicode escapes — content identical, all notebooks re-validated as JSON)
  • benchmarks/: wrapped 20 genuinely long code lines (bench.py, harness_metrics.py, results_schema.py); RET504 ×3 inlined; E741 l renamed ×2; F841 dead assignments removed — including a genuinely dead gold-labels block in harness_metrics.py (assigned, conditionally reassigned, never read); PLE0604 __all__ made literal and verified at runtime against REGISTRY keys

Ignored via the repo's established per-file-ignore conventions:

  • benchmarks/* → PLC0415 (lazy imports of optional heavy deps are the point; consolidates 4 existing per-file entries)
  • benchmarks/fixtures/* → E501 (defect tables read as one row per line; wrapping destroys the tabular readability the fixtures exist for)
  • the two linear builder/orchestration functions → PLR0915 (matching the existing model_select.py / outliers.py entries)

Excluded: freshdata-benchmarks/ (extend-exclude) — ASV-managed sub-project with tool-generated layout and per-machine result artifacts (.asv/results/Johnnys-MacBook-Air.local/...); not shipped, not held to the package lint bar.

Verification

  • ruff check . → All checks passed
  • Touched benchmark modules compiled + smoke-run (fixtures.REGISTRY['crm'].generate(200)); __all__ asserted equal to registry keys
  • Full gate pytest -m "not online and not large": green, coverage 93.55%
  • mypy src/freshdata clean

CI linted only src/tests; repo-wide ruff had 368 errors. Now zero:

- notebooks: import sorting + PLR0402 alias fix (ruff --fix; the ipynb
  rewrite also normalized cell ids and unicode escapes — content
  unchanged, all notebooks still valid JSON)
- benchmarks: wrapped genuinely long code lines (bench.py,
  harness_metrics.py, results_schema.py); fixed RET504/E741/F841/PLE0604
  (dead gold-labels block in harness_metrics removed; __all__ now
  literal and verified against REGISTRY keys); per-file-ignores extended
  with the established conventions: PLC0415 for all of benchmarks/
  (lazy optional-dep imports are the point), E501 for fixtures/ (defect
  tables read as one row per line), PLR0915 for the two linear
  builder/orchestration functions
- freshdata-benchmarks/: excluded via extend-exclude — ASV-managed
  sub-project with tool-generated layout and per-machine result
  artifacts, not shipped, not held to the package lint bar
- CI: ci.yml + release.yml lint steps widened to 'ruff check .'

No runtime behavior changes; full gate green, coverage 93.55%.
@strix-security

strix-security Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Strix Security Review

No security issues found.

Updated for 8f4e547.


Reviewed by Strix
Re-run review · Configure security review settings

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@JohnnyWilson16, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cae94f25-9b32-46f7-b4dc-1892616e46cd

📥 Commits

Reviewing files that changed from the base of the PR and between 426d57a and 8f4e547.

📒 Files selected for processing (21)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • CHANGELOG.md
  • benchmarks/baselines/pandas_baseline.py
  • benchmarks/baselines/pyjanitor_baseline.py
  • benchmarks/bench.py
  • benchmarks/fixtures/__init__.py
  • benchmarks/fixtures/_common.py
  • benchmarks/fixtures/crm.py
  • benchmarks/fixtures/event_log.py
  • benchmarks/fixtures/finance.py
  • benchmarks/fixtures/gold.py
  • benchmarks/fixtures/provenance.py
  • benchmarks/fixtures/wide_schema.py
  • benchmarks/harness_metrics.py
  • benchmarks/results_schema.py
  • notebooks/06_context_cleaning.ipynb
  • notebooks/08_plan_approval.ipynb
  • notebooks/09_optional_semantic_models.ipynb
  • notebooks/10_learning_profiles.ipynb
  • pyproject.toml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/repo-wide-ruff-jwd

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

FreshData benchmark report — 2026-07-11T05:01:04Z

  • freshdata: 1.1.1
  • python: 3.12.13
  • platform: Linux-6.17.0-1018-azure-x86_64-with-glibc2.39
fixture n_rows n_cols p50 s p95 s peak MB repair % false-repair % preserve % trust monotonic export %
crm 10,200 40 1.303 1.304 13.8 100.0 0.0 100.0 93.84 ✅ 100.0
event_log 10,000 25 0.486 0.487 5.1 100.0 0.0 100.0 99.677 ✅ 100.0
finance 10,200 60 1.651 1.675 18.3 100.0 0.0 100.0 99.499 ✅ 100.0
gold 10,200 7 0.187 0.187 3.7 100.0 0.0 100.0 98.3 ✅ 100.0
provenance 10,000 18 0.403 0.404 7.3 100.0 0.0 100.0 99.765 ✅ 100.0
wide_schema 10,000 100 3.089 3.089 13.4 100.0 0.0 100.0 96.042 ✅ 100.0

Authored-code reduction (Metric 6)

  • FreshData: 3 lines
  • pandas baseline: 25 lines (88.0% reduction)

@JohnnyWilson16
JohnnyWilson16 merged commit 613dc18 into main Jul 11, 2026
15 checks passed
@kevincostner17
kevincostner17 deleted the chore/repo-wide-ruff-jwd branch September 14, 2026 20:25
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.

Repository-wide Ruff check fails on committed notebooks and debug script

2 participants