Skip to content

Conversation

@diego-plan9
Copy link
Member

Summary

Introduce ruff as an additional linter, in order to cover some more checks (and automated fixes) with minimal performance hit:

  • the ruleset is a combination of Qiskit and samplomatic, tuned to this project
  • changes are a result of the --fix option, except for hand-introduced noqa entries
  • invocation is part of the make lint target

Details and comments

Fixes #2513

Copy link
Collaborator

@yaelbh yaelbh left a comment

Choose a reason for hiding this comment

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

Do qiskit and samplomatic also employ both pylint and ruff?

@diego-plan9
Copy link
Member Author

Do qiskit and samplomatic also employ both pylint and ruff?

Qiskit employs both (ruff in an experimental capability) and samplomatic just ruff.

Copy link
Collaborator

@yaelbh yaelbh left a comment

Choose a reason for hiding this comment

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

We should also use only ruff, there's no reason to spend time with two linters. Not in this PR of course.

@diego-plan9
Copy link
Member Author

We should also use only ruff, there's no reason to spend time with two linters. Not in this PR of course.

I like that thought actually - pylint is more strict, but ruff supports a subset (plus has more rulesets that can be enabled and might match the desires). Part of a longer conversation indeed!

@diego-plan9 diego-plan9 added this pull request to the merge queue Dec 23, 2025
Merged via the queue into Qiskit:main with commit cd49da0 Dec 23, 2025
17 checks passed
@diego-plan9 diego-plan9 deleted the feature/introduce-ruff branch December 23, 2025 10:55
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.

Add ruff as part of the tooling

2 participants