Skip to content

Add more ruff rules (B, PTH, RSE, SIM)#4034

Open
mashehu wants to merge 50 commits intonf-core:devfrom
mashehu:new-ruff-rules
Open

Add more ruff rules (B, PTH, RSE, SIM)#4034
mashehu wants to merge 50 commits intonf-core:devfrom
mashehu:new-ruff-rules

Conversation

@mashehu
Copy link
Contributor

@mashehu mashehu commented Feb 11, 2026

Additional rules we could add:

  • "C4", # flake8-comprehensions - better list/dict/set comprehensions
  • "RUF", # Ruff-specific rules - includes RUF103/104 for validating suppressions
  • "SIM", # flake8-simplify - simplifies code patterns
  • "PIE", # flake8-pie - misc lints for common issues
  • "RSE", # flake8-raise - unnecessary parentheses on raised exceptions
  • "RET", # flake8-return - unnecessary variable assignments before return
  • "ARG", # flake8-unused-arguments - finds unused function arguments
  • "BLE", # flake8-blind-except - catches blind except clauses
  • "A", # flake8-builtins - catches shadowing of Python builtins
  • "TRY", # tryceratops - exception handling best practices

@mashehu mashehu requested a review from a team February 11, 2026 10:14
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 66.76218% with 116 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.45%. Comparing base (ee746b3) to head (a84464a).

Files with missing lines Patch % Lines
nf_core/pipelines/schema.py 43.33% 17 Missing ⚠️
nf_core/synced_repo.py 28.57% 10 Missing ⚠️
nf_core/pipelines/list.py 62.50% 9 Missing ⚠️
nf_core/pipelines/create/githubrepo.py 30.00% 7 Missing ⚠️
nf_core/components/update.py 62.50% 6 Missing ⚠️
nf_core/pipelines/refgenie.py 0.00% 6 Missing ⚠️
nf_core/pipelines/rocrate.py 62.50% 6 Missing ⚠️
nf_core/modules/modules_json.py 66.66% 5 Missing ⚠️
nf_core/modules/modules_repo.py 16.66% 5 Missing ⚠️
nf_core/components/remove.py 33.33% 4 Missing ⚠️
... and 24 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mashehu mashehu changed the title Add more ruff rules (B, PTH) Add more ruff rules (B, PTH, RSE) Feb 11, 2026
@mashehu mashehu changed the title Add more ruff rules (B, PTH, RSE) Add more ruff rules (B, PTH, RSE, SIM) Feb 12, 2026
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.

2 participants