Skip to content

Switch from pylint+black to ruff#927

Merged
valyo merged 7 commits intoScilifelabDataCentre:devfrom
mashehu:switch-to-ruff
Feb 26, 2026
Merged

Switch from pylint+black to ruff#927
valyo merged 7 commits intoScilifelabDataCentre:devfrom
mashehu:switch-to-ruff

Conversation

@mashehu
Copy link
Contributor

@mashehu mashehu commented Feb 25, 2026

Pull Request Template

Before Marking as Ready for Review

  • Add relevant information to the sections below (Summary etc)
  • Rebase or merge the latest dev (or other targeted branch)
  • Update documentation if needed
  • Add an entry to the SPRINTLOG.md if needed
  • Choose an appropriate label. See here for information on the labelling options
  • The code follows the style guidelines
  • Perform a self-review: read the diff as if reviewing someone else's code
  • I have commented the code, particularly in hard-to-understand areas
  • Verify that all checks and tests have passed

If the target branch is master:

Summary

As recommend in https://github.com/ScilifelabDataCentre/development-guidelines/blob/main/paved_path_tech/paved_path_tools.md#linting--static-analysis ruff is faster replacement of pylint and black.
It comes with even more rules that can be added gradually.
I would highly recommend to add the following rules:

  • "I" (isort)
  • "UP" (pyupgrade)

One that recently turned out to be helpful for us at nf-core:

  • "B" (flake8-bugbear, catches common bugs and design problems)

Related Issue/Ticket

Testing

Reviewer Notes

The only previously used pylint rule that is not yet covered in ruff is too-many-ancestors.
The rest should be 1:1 replacement of the previous settings.

I also bumped the targetVersion in the pyproject.toml, feel free to revert.
But python<3.10 reached end-of-life, last fall: https://devguide.python.org/versions/

@mashehu mashehu marked this pull request as ready for review February 25, 2026 12:51
@mashehu mashehu requested a review from a team as a code owner February 25, 2026 12:51
@valyo valyo mentioned this pull request Feb 25, 2026
10 tasks
@valyo
Copy link
Member

valyo commented Feb 25, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bccf262049

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

steps:
- uses: actions/checkout@v4
- name: Install ruff
run: pip install ruff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better pinning ruff to a certain version to avoid the check failing without code changes

@valyo valyo mentioned this pull request Feb 26, 2026
10 tasks
valyo added a commit that referenced this pull request Feb 26, 2026
@valyo valyo merged commit 93dbcd9 into ScilifelabDataCentre:dev Feb 26, 2026
8 of 10 checks passed
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 20.51282% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.45%. Comparing base (342abc1) to head (cd2ad89).
⚠️ Report is 19 commits behind head on dev.

Files with missing lines Patch % Lines
dds_cli/__main__.py 5.26% 18 Missing ⚠️
dds_cli/file_handler_local.py 14.28% 6 Missing ⚠️
dds_cli/user.py 25.00% 3 Missing ⚠️
dds_cli/project_status.py 0.00% 2 Missing ⚠️
dds_cli/data_lister.py 0.00% 1 Missing ⚠️
dds_cli/file_encryptor.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #927   +/-   ##
=======================================
  Coverage   54.45%   54.45%           
=======================================
  Files          33       33           
  Lines        3043     3043           
=======================================
  Hits         1657     1657           
  Misses       1386     1386           

☔ 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.

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