Pranavkhade / PACKMAN

PACKMAN: PACKing and Motion ANalysis
Other
33 stars 7 forks source link

ruff --select=E711,E712 --fix . #43

Closed cclauss closed 1 year ago

cclauss commented 1 year ago

% ruff --select=E711,E712 --fix . # and manually fixed ruff rule F402


% ruff rule E711

none-comparison (E711)

Derived from the pycodestyle linter.

Autofix is always available.

What it does

Checks for comparisons to None which are not using the is operator.

Why is this bad?

Per PEP 8, "Comparisons to singletons like None should always be done with is or is not, never the equality operators."

Example

if arg != None:
if None == arg:

Use instead:

if arg is not None:

References

Derived from the pycodestyle linter.

Autofix is always available.

What it does

Checks for comparisons to booleans which are not using the is operator.

Why is this bad?

Per PEP 8, "Comparisons to singletons like None should always be done with is or is not, never the equality operators."

Example

if arg == True:
if False == arg:

Use instead:

if arg is True:
if arg is False:

References

Derived from the Pyflakes linter.

Message formats:

Pranavkhade commented 1 year ago

Thank you @cclauss