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

Avocado utils lint warnings #6041

Merged

Conversation

clebergnu
Copy link
Contributor

This solves the lint warnings, removing all check exceptions from the pylint configuration for avocado/utils.

This is part of: #6034

@clebergnu clebergnu added this to the 109 - Codename TBD milestone Oct 14, 2024
@clebergnu clebergnu self-assigned this Oct 14, 2024
Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

Hi @clebergnu, thank you for this update. The changes LGTM, I am just missing the update to avocado-static-checks.conf file which would enable this configuration in our selftests. IIUIC without it your changes are not properly tested in CI, am I right?

.pylintrc_utils Show resolved Hide resolved
For the sake of incorporating a fix on check-lint, where the return
code signals any failures in the executed checks, as opposed to just
the last check.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
In order to have "avocado/utils" in a way that can be easily
transported to the autils project, it's necessary to have the closest
lint configuration possible (ideally, the same).

This introduces a configuration file that is a copy of the existing
".pylintrc" file.  The goal is that further commits will address other
warnings and bring the exceptions as close as possible to the
"avocado-static-checks" default pylint configuration file, which has
no exceptions.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
For this change, there was the possibility of making changes
compatible with "logging-format-style=old" (the default), or jumping
the gun and making changes compatible with "logging-format-style=new".
The earlier approach was chosen because the goal is to get closer to:

* A default pylint configuration (as shipped/generated by pylint
  itself)
* The configuration provided by avocado-static-checks and used by
  autils

Reference: https://pylint.pycqa.org/en/latest/user_guide/messages/warning/logging-fstring-interpolation.html
Signed-off-by: Cleber Rosa <crosa@redhat.com>
The "broad-except" has been renamed to "broad-exception-caught",
warning number W0718.  So it can be removed from the configuration
file.

Reference: https://pylint.pycqa.org/en/latest/user_guide/messages/warning/broad-except.html
Signed-off-by: Cleber Rosa <crosa@redhat.com>
There are a few occurrences where code is being used to keep track of
possible improvements.  Many times these will go unnoticed for ages.

Let's either document the limitations that are affected by the
"TODO"s, or remove them because after quite some time, they were not
something that was attempted to be improved or fixed.

https://pylint.pycqa.org/en/latest/user_guide/messages/warning/fixme.html
Signed-off-by: Cleber Rosa <crosa@redhat.com>
No occurrence of this warning was found in avocado/utils.

Reference: https://pylint.pycqa.org/en/latest/user_guide/messages/warning/protected-access.html
Signed-off-by: Cleber Rosa <crosa@redhat.com>
@clebergnu clebergnu force-pushed the avocado_utils_lint_warnings branch from 3db595d to f8537a5 Compare October 24, 2024 11:52
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 13.97849% with 80 lines in your changes missing coverage. Please review.

Project coverage is 54.42%. Comparing base (d5569ca) to head (f8537a5).
Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
avocado/utils/network/interfaces.py 0.00% 22 Missing ⚠️
avocado/utils/lv_utils.py 0.00% 10 Missing ⚠️
avocado/utils/partition.py 11.11% 8 Missing ⚠️
avocado/utils/asset.py 25.00% 6 Missing ⚠️
avocado/utils/disk.py 0.00% 6 Missing ⚠️
avocado/utils/sysinfo.py 16.66% 5 Missing ⚠️
avocado/utils/cpu.py 0.00% 3 Missing ⚠️
avocado/utils/multipath.py 0.00% 3 Missing ⚠️
avocado/utils/network/hosts.py 0.00% 3 Missing ⚠️
avocado/utils/archive.py 0.00% 2 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6041      +/-   ##
==========================================
- Coverage   54.47%   54.42%   -0.05%     
==========================================
  Files         202      202              
  Lines       21874    21885      +11     
==========================================
- Hits        11915    11911       -4     
- Misses       9959     9974      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the update.

@richtja richtja merged commit 16c39ea into avocado-framework:master Oct 29, 2024
59 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done 109
Development

Successfully merging this pull request may close these issues.

2 participants