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

Removing lint rules that are unused #12217

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

joesho112358
Copy link
Contributor

Summary

#9614 removing some of the rules that currently do not result in an error

Details and comments

Removing
unknown-option-value
unnecessary-direct-lambda-call
unnecessary-ellipsis
use-list-literal
because they do not appear to currently trigger. Figure they can be looked at again if they ever do cause an issue. Otherwise, I can close this and push them above for long term removal.

It does appear that use-list-literal vs use-dict-literal is inconsistent:

data = models.ExperimentResultData(counts=dict(**raw_counts))
exp_result = models.ExperimentResult(shots=14, success=True, meas_level=2, data=data)
result = Result(results=[exp_result], **self.base_result_args)

Line 59 defines a dictionary with dict(...) and line 61 defines a list with [...]

@joesho112358 joesho112358 requested a review from a team as a code owner April 19, 2024 01:43
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Apr 19, 2024
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks!

That discrepancy you highlighted in dict(**mapping) was likely overzealous find-and-replace than a particular intention to use the dict constructor. The Result code used to use a very heavy validation library that made everything into objects with expensive schemas backing it, so there was loads of stuff like RandomObject(**deserialised) to try and stuff data back into the validators. Some of those just became raw dict instances, so we probably accidentally ended up with this funny dict(**dict) stuff, which at the time there was no lint against.

@jakelishman jakelishman enabled auto-merge April 19, 2024 01:56
@jakelishman jakelishman added type: qa Issues and PRs that relate to testing and code quality Changelog: None Do not include in changelog labels Apr 19, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8747199799

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 11 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.02%) to 89.274%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 92.37%
crates/qasm2/src/parse.rs 6 97.61%
Totals Coverage Status
Change from base Build 8745563164: 0.02%
Covered Lines: 60320
Relevant Lines: 67567

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Apr 19, 2024
Merged via the queue into Qiskit:main with commit 5fb343f Apr 19, 2024
12 checks passed
@joesho112358 joesho112358 deleted the remove-unused-lint-rules branch April 25, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo type: qa Issues and PRs that relate to testing and code quality
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants