Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
Visit mjrecent on Telegram's user avatar
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 ...
Øyvind Evju's user avatar
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 ...
link89's user avatar
  • 1,661
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 = ...
John Moutafis's user avatar
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 ...
Tomi Kokkonen's user avatar