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

Enable many ruff checks #476

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

inknos
Copy link
Contributor

@inknos inknos commented Nov 29, 2024

Depends on #473

Signed-off-by: Nicola Sella <[email protected]>
Signed-off-by: Nicola Sella <[email protected]>
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]>
Checks for the use of the characters 'l', 'O', or 'I' as variable names.

Signed-off-by: Nicola Sella <[email protected]>
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]>
Check for unused variables. Unused variables should be prefixed with '_'

Signed-off-by: Nicola Sella <[email protected]>
Signed-off-by: Nicola Sella <[email protected]>
Signed-off-by: Nicola Sella <[email protected]>
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]>
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]>
It is recommended to use 2 or more to give the caller more context about
warning

Signed-off-by: Nicola Sella <[email protected]>
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]>
Bugbear checks usually check for design problems within the code.

https://pypi.org/project/flake8-bugbear/

Signed-off-by: Nicola Sella <[email protected]>
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]>
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]>
Bandit provides security checks and good practices suggestions for the
codebase.

https://pypi.org/project/flake8-bandit/

Signed-off-by: Nicola Sella <[email protected]>
Copy link
Contributor

openshift-ci bot commented Nov 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inknos

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant