-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/mypy precommit #6
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
base: development
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, added a few suggestions.
b7cf814
to
50255ed
Compare
Ignored mypy errors on the existing files that were throwing errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think that we should be adding so many modules to the ignores. If there are type issues in these modules they should be addressed prior to merge.
pyproject.toml
Outdated
@@ -57,4 +58,4 @@ profile = "black" | |||
|
|||
[tool.ruff.lint] | |||
select = ["F", "B", "T20", "N", "W", "I", "E"] | |||
ignore = ["E501", "N806"] | |||
ignore = ["E501", "N806", "B010"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding this to the ignores?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruff has an issue with one of the mypy changes I made, I think it was the Union error so Ruff would fail as well with the mypy change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sidamd can you please double check where this B010 is being thrown and try to rework the code so its not thrown. I looked up the error code and its related to a redundant boolean operation which sounds like it can be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 122 of the dataanalyzer file ruff has an error where it prefers direct assignment of a variable. But if I use direct assignment of a variable then mypy will have an issue that I using direct assignment of a variable. I can remove the ignore in the pyproject and just add a comment to ignore the ruff error on line 122 of the dataanalyzer file if you guys prefer that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes this sounds reasonable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@landrews-amd I removed the ruff ignore. Just added the ruff ignore comment to the dataanalyzertask file.
I think we should do this incremental. This PR already has many files modified, we can work on the ignored files in future PRs and not post 1 huge PR. I think this was what we had decided initially, to gradually add mypy to files. Since @sidamd enabled mypy, those files will currently fail, so i think ignoring them in this PR is OK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
added mypy to pre-commit hooks and dependencies list. Fixed dataanalyzer interface, task.py, event.py, tablesummary.py, and cmd_analyzer.py to pass mypy type checks.