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

Unused variables and constants #432

Closed
trishankatdatadog opened this issue Sep 22, 2022 · 3 comments · Fixed by #490
Closed

Unused variables and constants #432

trishankatdatadog opened this issue Sep 22, 2022 · 3 comments · Fixed by #490

Comments

@trishankatdatadog
Copy link
Contributor

Description of issue or feature request:

There are unused variables and constants everywhere. We should add a linter to catch them.

@joshuagl
Copy link
Collaborator

+1, there are rather a lot of unused imports.

Our custom coding style prevented us adding an automated linter like black in the past and, frankly, likely prevented anyone from putting in the effort to use another less opinionated linter. We do have an old issue about linting at least new files #243 however, we didn't get much further than running mypy against new files.

@trishankatdatadog
Copy link
Contributor Author

I think we should just move over to standard coding style enforced by common linters, TBH, not easy to follow and check for a custom style

@lukpueh
Copy link
Member

lukpueh commented Oct 20, 2022

FYI:
#439 formats everything with black and isort, and enables pylint and bandit.

To make review of #439 as easy as possible, I just disabled pylint for all lines that were flagged by adding # pylint: disable=... inline comments.

To fix this issue here, I suggest to

  1. Merge #439
  2. Find relevant lines by grep -ro '# pylint: disable=.*unused.*$' tests securesystemslib
  3. Fix & PR

jku added a commit to jku/securesystemslib that referenced this issue Dec 27, 2022
* unused-variable: remove variables altogether or name them "_".
* unused-import: remove import
* consider-using-from-import: Use from-import
* Remove version checks for python <=3.3

There are some very minor import order changes: I expect no
functionality changes.

Fixes secure-systems-lab#432
@jku jku mentioned this issue Dec 27, 2022
jku added a commit to jku/securesystemslib that referenced this issue Dec 29, 2022
* unused-variable: remove variables altogether or name them "_".
* unused-import: remove import
* consider-using-from-import: Use from-import
* Remove version checks for python <=3.3

There are some very minor import order changes: I expect no
functionality changes.

Fixes secure-systems-lab#432
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 a pull request may close this issue.

3 participants