Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable a reduced set of pylint checks #146

Merged
merged 8 commits into from
Sep 13, 2023
Merged

Enable a reduced set of pylint checks #146

merged 8 commits into from
Sep 13, 2023

Conversation

garrison
Copy link
Member

@garrison garrison commented May 8, 2023

This is an experiment to see what would have to change in our code base to enable the same set of pylint checks that we've been using internally. Since pylint can be slow to execute, I've put it as the final check in the lint workflow in tox.ini.

I wonder if it would be possible to use ruff under nbqa. (EDIT: yes, see #147.) If it's possible, would it have caught most of these?

Opening for discussion, mainly.

@coveralls
Copy link

coveralls commented May 8, 2023

Pull Request Test Coverage Report for Build 6163951208

  • 1 of 3 (33.33%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 92.356%

Changes Missing Coverage Covered Lines Changed/Added Lines %
circuit_knitting/forging/entanglement_forging_ansatz.py 0 1 0.0%
circuit_knitting/forging/entanglement_forging_operator.py 0 1 0.0%
Totals Coverage Status
Change from base Build 6161687117: 0.5%
Covered Lines: 2948
Relevant Lines: 3192

💛 - Coveralls

@garrison
Copy link
Member Author

garrison commented May 8, 2023

I think we should see what is left after #147 merges, then evaluate whether pylint catches enough that it is worth the extra time during the lint workflow. Adding the "on hold" label until then.

@garrison garrison added the on hold Let's wait for something before merging label May 8, 2023
@garrison garrison added the code quality Related to style, linters, etc. label Jun 2, 2023
@garrison garrison marked this pull request as draft June 7, 2023 21:51
@garrison garrison removed the on hold Let's wait for something before merging label Jun 8, 2023
garrison added a commit that referenced this pull request Sep 12, 2023
This is something that pylint should have caught if we were using it
(#146).  This way, the tracebacks will say

> The above exception was the direct cause of the following exception:

rather than

> During handling of the above exception, another exception occurred:
garrison added a commit that referenced this pull request Sep 12, 2023
This is something that pylint should have caught if we were using it
(#146).  This way, the tracebacks will say

> The above exception was the direct cause of the following exception:

rather than

> During handling of the above exception, another exception occurred:
> circuit_knitting/cutting/cutqc/wire_cutting.py:226:4: W0622: Redefining built-in 'bin' (redefined-builtin)
@garrison garrison marked this pull request as ready for review September 12, 2023 19:23
@garrison
Copy link
Member Author

garrison commented Sep 12, 2023

Ruff is obviously missing a few things we care about (e.g., #415, #319), so I've revived this.

@garrison garrison merged commit 6bb6fec into main Sep 13, 2023
9 checks passed
@garrison garrison deleted the pylint branch September 13, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Related to style, linters, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants