You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Pivot to using ruff for all linting
This commit switches us to fully using ruff for all the linting in CI
and locally. The primary motivation for this change is to improve
productivity because ruff is signficantly faster. Pylint is incredibly
slow in general, but compared to ruff especially so. For example, on my
laptop ruff takes 0.04 seconds to run on the qiskit/ subdirectory (after
clearing the cache, with the cache populated it takes 0.025 sec) of the
source tree while running pylint on the same path took 70 sec. This leads
to people skipping lint locally and causes churn in CI becaus.
We had started to experimenting with ruff in the past and
used it for a some small set of rules but were still using pylint for
the bulk of the linting in the repo. The concern at the time was a loss
of lint coverage or a lot of code churn caused by migrating to a new tool.
Specifically pylint does more type inference and checking that ruff
doesn't. However since we started the experiment one major change in
qiskit is how much work is happening in rust now vs Python. At this
point any loss in lint coverage is unlikely to cause a significant
problem in practice and we'll make real productivity gains by making
this change.
* Remove out of date comment
* Update makefile
* Enable more rules
* Revert lambda autofixes
* Fix new rules
* Add bandit rules
* Enable Ruff native rules
* Remove pylint disable comments
* Enable docstring rules
This commit adds the docstring rules on the repo. This involves a few
more changes than previous commits because there are a lot of formatting
consistency rules that needed to be auto-applied. The checking also
found several instances where there was missing documentation that
should have been included.
* Add categories from old ruff config
* Fix from rebase
* Add flake8-raise rule
* Add flake8-pie rules
* Add implicit namespace rules
* Fix deprecation decorator error on import
* Fix __init__ docstring for deprecated circuit library elements
* Revert "Enable docstring rules"
The formatting changes that ruff auto applied to the docstrings were not
valid in many cases. The changeset for the commit was too large to
systematically revert just the incorrect autoformatting and disabling
those rules. Instead this reverts commit
f928646 on the whole. We can circle back
and add a reduced subset of the docstring rules that makes sense and a
functional docs build after the revert.
* Fix typo in latex circuit drawer changes
* Fix csp tests for rng change
* Remove unused typing imports
* Bump to ruff 0.15.2
Since this PR was first opened there have been several new ruff
releases. This updates to the latest release as of this commit. The
0.15.0 release included a new default rule in the RUF ruleset which
triggered on the code base which this also fixes.
0 commit comments