Skip to content

Enhancement | Lint with ruff in CI and pre-commit, drop pylint - #353

Merged
diego-ojeda-binbash merged 2 commits into
masterfrom
feature/ruff-lint
Nov 14, 2026
Merged

diego-ojeda-binbash merged 2 commits into
masterfrom
feature/ruff-lint

Conversation

@diego-ojeda-binbash

Copy link
Copy Markdown
Contributor

What?

Two commits:

1. Fix | Clear the ruff findings. 33 findings, no behavior change:

  • f-strings without placeholders become plain strings
  • not x in y becomes x not in y
  • unused imports and variables are dropped
  • the logger's _TIME_FORMAT lambda becomes a function
  • test_discover now also asserts the clusters were scanned, using the mock it bound and never read

2. Enhancement | Lint with ruff in CI and pre-commit, drop pylint

Area Change
Rules [tool.ruff] in pyproject.toml: pyflakes (F) plus the pycodestyle errors (E4, E7, E9). Mistakes, not style: black still owns formatting
CI The required lint job runs ruff 0.17.5 after black, through astral-sh/ruff-action pinned by SHA. Also actions/checkout@v4 with persist-credentials: false
pre-commit ruff-check hook
Dependencies Removes pylint 2.8.3 (never ran in CI, does not support Python 3.12+) and .pylintrc. Adds ruff. poetry.lock is regenerated with Poetry 1.8.2 (as in CI) and --no-update: only pylint and its 6 dependencies leave, nothing else moves
Docs CLAUDE.md and README.md

Why?

#346: there was no semantic linter in CI. pylint was configured but never ran, and its pinned version cannot run on the Python versions we support.

Open PRs

Not in this PR

pre-commit run --all-files already failed on black with tests/build_scripts/simple_build_bad_syntax.py: pre-commit passes files explicitly, so black ignores extend-exclude unless the hook adds --force-exclude.

Relates to #346

🤖 Generated with Claude Code

diego-ojeda-binbash and others added 2 commits November 14, 2026 16:10
No behavior change:
* f-strings without placeholders become plain strings
* `not x in y` becomes `x not in y`
* unused imports and variables are dropped
* the logger's `_TIME_FORMAT` lambda becomes a function

test_discover now also checks the clusters were scanned, which uses the
mock it was binding and never reading.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
* [tool.ruff] in pyproject.toml selects pyflakes (F) and the pycodestyle
  errors (E4, E7, E9): mistakes, not style; black still owns formatting.
* The required `lint` job runs ruff 0.17.5 after black, through
  astral-sh/ruff-action pinned by SHA. pre-commit gets the ruff-check hook.
* pylint 2.8.3, which never ran in CI and does not support Python 3.12+,
  is removed with .pylintrc. poetry.lock regenerated with Poetry 1.8.2
  (as in CI) and --no-update: only pylint's tree goes, ruff comes in.
* F541 stays ignored in _backend_config.py until #333 merges, to avoid
  conflicting with it.

Relates to #346

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@diego-ojeda-binbash diego-ojeda-binbash added enhancement New feature or request test labels Nov 14, 2026
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3ca0878c-ce95-4eee-bc84-8bcb7f2c8c80
Commits

Reviewing files that changed from the base of the PR and between e4e6c38 and 3b2119e.

Files ignored due to path filters: 1

  • poetry.lock is excluded by !**/*.lock
Files selected for processing: 21

  • .github/workflows/test-lint-black.yaml
  • .pre-commit-config.yaml
  • .pylintrc
  • CLAUDE.md
  • README.md
  • leverage/logger.py
  • leverage/modules/auth.py
  • leverage/modules/aws.py
  • leverage/modules/credentials.py
  • leverage/modules/kubectl.py
  • leverage/modules/project.py
  • leverage/modules/tf.py
  • leverage/modules/tfautomv.py
  • leverage/modules/tfrunner.py
  • leverage/path.py
  • pyproject.toml
  • tests/conftest.py
  • tests/test_conf.py
  • tests/test_modules/test_kubectl.py
  • tests/test_modules/test_run.py
  • tests/test_modules/test_runner.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@diego-ojeda-binbash diego-ojeda-binbash self-assigned this Nov 14, 2026
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 43630606152

Coverage decreased (-0.02%) to 73.049%

Details

  • Coverage decreased (-0.02%) from the base build.
  • Patch coverage: 3 uncovered changes across 2 files (11 of 14 lines covered, 78.57%).
  • 62 coverage regressions across 3 files.

Uncovered Changes

File Changed Covered %
leverage/modules/kubectl.py 2 0 0.0%
leverage/modules/auth.py 1 0 0.0%
Total (7 files) 14 11 78.57%

Coverage Regressions

62 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
modules/project.py 48 31.94%
modules/kubectl.py 13 60.66%
modules/tfrunner.py 1 94.29%

Coverage Stats

Coverage Status
Relevant Lines: 4070
Covered Lines: 3106
Line Coverage: 76.31%
Relevant Branches: 1080
Covered Branches: 656
Branch Coverage: 60.74%
Branches in Coverage %: Yes
Coverage Strength: 0.76 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants