-
Notifications
You must be signed in to change notification settings - Fork 97
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
Enable many ruff checks #476
base: main
Are you sure you want to change the base?
Commits on Dec 2, 2024
-
Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for efa8b48 - Browse repository at this point
Copy the full SHA efa8b48View commit details -
Fix files to comply with pre-commit
Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4151c63 - Browse repository at this point
Copy the full SHA 4151c63View commit details -
Update lint, format checks in tox and cirrus files
Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for eef0489 - Browse repository at this point
Copy the full SHA eef0489View commit details -
Fix Pycodestyle E722: bare-except
Catching BaseException can make it hard to interrupt the program (e.g., with Ctrl-C) and can disguise other problems. Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 24b61cd - Browse repository at this point
Copy the full SHA 24b61cdView commit details -
Fix Pycodestyle E741: ambiguous-variable-name
Checks for the use of the characters 'l', 'O', or 'I' as variable names. Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b68959f - Browse repository at this point
Copy the full SHA b68959fView commit details -
Fix Pycodestyle E402, Pyflakes F401 and Bandit S101
F401: unused-import E402: module-import-not-at-top-of-file S101: assert Assertions are removed when Python is run with optimization requested (i.e., when the -O flag is present), which is a common practice in production environments. As such, assertions should not be used for runtime validation of user input or to enforce interface constraints. Signed-off-by: Nicola Sella <[email protected]> Unused import Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 78b7719 - Browse repository at this point
Copy the full SHA 78b7719View commit details -
Fix Pyflakes F841: unused-variable
Check for unused variables. Unused variables should be prefixed with '_' Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0c44357 - Browse repository at this point
Copy the full SHA 0c44357View commit details -
Fix Pylint PLW2901: redefined-loop-name
More on why it is bad here: https://docs.astral.sh/ruff/rules/redefined-loop-name/ Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ae96ee4 - Browse repository at this point
Copy the full SHA ae96ee4View commit details -
Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cd9917d - Browse repository at this point
Copy the full SHA cd9917dView commit details -
Fix Pycodestyle E501: line-too-long
This is a quality of life improvement and it should be backward compatible with our previous set line-length Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for af4a128 - Browse repository at this point
Copy the full SHA af4a128View commit details -
Fix sys.version_info comparisons and drop unsupported python code Furthermore, addresses UP008: super-call-with-parameters Super is not called with parameters anymore when the first argument is __class__ and the second argument is equivalent to the first argument of the enclosing method Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f08b4af - Browse repository at this point
Copy the full SHA f08b4afView commit details -
Fix Bugbear B028: no-explicit-stacklevel
It is recommended to use 2 or more to give the caller more context about warning Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9adc703 - Browse repository at this point
Copy the full SHA 9adc703View commit details -
B024: abstract-base-class-without-abstract-method PodmanResource is not an abstract class and the ABC inheritance should be removed Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for df3ea3e - Browse repository at this point
Copy the full SHA df3ea3eView commit details -
Bugbear checks usually check for design problems within the code. https://pypi.org/project/flake8-bugbear/ Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6ef117c - Browse repository at this point
Copy the full SHA 6ef117cView commit details -
Suppress Bandit S108: hardcoded-temp-file
This could be an exception and should be checked in the future but it is suppressed at the moment. Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ed52f0c - Browse repository at this point
Copy the full SHA ed52f0cView commit details -
S603: subprocess-without-shell-equals-true This could be an exception or a false positive and since it's used on one single piece of code it is ok to ignore from now. Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5f162e1 - Browse repository at this point
Copy the full SHA 5f162e1View commit details -
Bandit provides security checks and good practices suggestions for the codebase. https://pypi.org/project/flake8-bandit/ Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 52a135a - Browse repository at this point
Copy the full SHA 52a135aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1655b1a - Browse repository at this point
Copy the full SHA 1655b1aView commit details -
Fix Code based on ruff 0.3->0.8.1
Fix errors for tyope annotation for list, dict, type and tuple Example: UP006: Use `list` instead of `List` for type annotation Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1dcce71 - Browse repository at this point
Copy the full SHA 1dcce71View commit details -
Remove code that is never executed
Python Version is already set to be < 3.9 so this code will never run Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dd6de6a - Browse repository at this point
Copy the full SHA dd6de6aView commit details -
Remove pylint bare-except comment
Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a49e497 - Browse repository at this point
Copy the full SHA a49e497View commit details -
Disambiguate shadowed builtins without API break
This suppresses A003 for `list` builtin. `typing.List`, `typing.Dict`, `typing.Tuple` and `typing.Type` are deprecated. Removing these annotations breaks the calls to `list` when they are done within the same class scope, which makes them ambiguous. Typed returns `list` resolve to the function `list` defined in the class, shadowing the builtin function. This change is not great but a proper one would require changing the name of the class function `list` and breaking the API to be fixed. Example of where it breaks: podman/domains/images_manager.py class ImagesManager(...): def list(...): ... def pull( self, ... ) -> Image | list[Image], [[str]]: ... Here, the typed annotation of `pull` would resolve to the `list` method, rather than the builtin. Signed-off-by: Nicola Sella <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a151b12 - Browse repository at this point
Copy the full SHA a151b12View commit details