Include some ruff lint rules previously in lint.ignore#1376
Merged
Conversation
Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
Signed-off-by: Bharath <bharath.thotakura@infleqtion.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables several additional ruff rules that were previously suppressed via lint.ignore, and updates code (and a few docs notebooks) to comply with those rules across the repo.
Changes:
- Removes a set of ignored
ruffrules fromchecks_superstaq/checks-pyproject.toml. - Refactors multiple Python modules to satisfy the newly-enabled lint rules (e.g., simplified conditionals, safer dict iteration, corrected TypeVar variance naming).
- Updates documentation notebooks to remove unnecessary dict comprehensions and improve iteration patterns.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| supermarq-benchmarks/supermarq/qcvv/base_experiment.py | Renames the covariant TypeVar to follow variance naming conventions and propagates the new type throughout the class signatures. |
| supermarq-benchmarks/supermarq/plotting.py | Simplifies small conditional blocks into expressions to satisfy simplify rules. |
| supermarq-benchmarks/supermarq/converters/qiskit.py | Iterates over dict .items() to avoid key-index patterns and improve clarity. |
| qiskit-superstaq/qiskit_superstaq/superstaq_job.py | Collapses an if/else block into an expression for index selection. |
| general-superstaq/general_superstaq/superstaq_exceptions.py | Adds a targeted noqa for N818 on a public exception class. |
| general-superstaq/general_superstaq/superstaq_client.py | Simplifies query-string construction into a single expression. |
| general-superstaq/general_superstaq/job.py | Collapses if/else block into an expression when selecting circuits to check. |
| docs/source/optimizations/eeroq/eeroq_qss.ipynb | Replaces unnecessary dict comprehension with dict.fromkeys. |
| docs/source/apps/max_sharpe_ratio_optimization.ipynb | Refactors dict iteration to avoid indexing by loop variable; uses dict.fromkeys. |
| docs/source/apps/cudaq_logical_aim.ipynb | Uses .items() to avoid redundant dict indexing. |
| cirq-superstaq/cirq_superstaq/service.py | Collapses trivial if/else into an expression for linestyle selection. |
| cirq-superstaq/cirq_superstaq/ops/qubit_gates.py | Simplifies conditional assignment into an expression. |
| checks-superstaq/checks_superstaq/checks-pyproject.toml | Removes several lint ignores so ruff enforces those rules going forward. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.