All Questions
5 questions
3
votes
2
answers
85
views
Pylint and ruff don't complain about useless (unnecessary) return in functions with docstring
In pylint docs we read:
Emitted when a single "return" or "return None" statement is found at
the end of function or method definition. This statement can safely be
removed ...
0
votes
0
answers
112
views
Ruff linting rule for importing from "highest" available module
In my Python project, I have a structure akin to this:
a/
- __init__.py
b/
- __init__.py
c.py
Where an object C is defined in c.py, and a/__init__.py exports this object:
from a.b.c import ...
1
vote
0
answers
64
views
How to report `redefined-argument-from-local` as error in ruff?
In order to avoid making another bug due to override the function arguments in a for-loop, I find that there is a lint rule redefined-argument-from-local can detect this error. I try to enable this ...
2
votes
0
answers
143
views
Python Linter to catch user shadowed function names
Assume the following scenario:
def my_decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
# Code
return wrapper
def f():
# function code
return
f = ...
2
votes
1
answer
87
views
Is there a lint rule for python that automatically detects list +operator concatenation and suggests using spread
For me the following
extras = ["extra0", "extra1"]
func_with_list_arg([
"base0",
"base1",
] + extras)
is nicer to read with a spread operator like the ...