Conversation
* Missing encoding with open * Missing a docstring * Suppress warning that `ais-check` isn't in snake_case via a .pylintrc file
There was a problem hiding this comment.
Pull request overview
This PR addresses pylint warnings in the ais-check tool by adding an encoding parameter to a file open operation, adding a docstring to the main function, and creating a .pylintrc configuration file to suppress naming convention warnings for the hyphenated filename (which aligns with the project's style guide that mandates hyphens over underscores in file names).
Changes:
- Added
encoding="utf-8"parameter to the open() call for /proc/kallsyms to satisfy pylint's missing encoding warning - Added a docstring to the main() function to satisfy pylint's missing docstring requirement
- Created a .pylintrc file with an ignore-patterns directive to suppress pylint warnings about the hyphenated filename
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tools/ais-check/ais-check | Added encoding parameter to file open operation and added docstring to main() function |
| tools/ais-check/.pylintrc | New configuration file to suppress pylint warnings for the hyphenated filename |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def main(args): | ||
| """ | ||
| Parse command-line arguments, check AIS support in HIP Runtime and | ||
| amdgpu, optionally print the results, and return an exit code indicating | ||
| whether all required components support AIS. |
There was a problem hiding this comment.
main(args) never uses the args parameter and then reassigns args = parser.parse_args(), which makes the parameter misleading and can trigger pylint warnings (unused-argument / redefined-argument-from-local). Either remove the parameter and call parse_args() directly, or parse the provided argv (e.g., parse_args(args[1:])) and avoid shadowing by using a different local name.
These are trivial changes, but get us to a perfect pylint score. We are already fine for formatting via black.
ais-checkisn't in snake_case via a .pylintrc file