Florian Best

Results 155 issues of Florian Best

A fixer for `RET504 Unnecessary variable assignment before 'return' statement` would be nice. ```diff def random_zone(): - random_zone = f'{uts.random_string()}.{uts.random_string()}' - return random_zone + return f'{uts.random_string()}.{uts.random_string()}' ``` At least for...

autofix

A fixer for `C417` would be helpful. ```diff -map(lambda x: x * 2, bar) +[x * 2 for x in bar] ``` In #970 this is marked as done for...

autofix

https://pypi.org/project/com2ann/ is a nice project, which could be considered to be added. it tansforms type comments into real annotations: ```diff -def foo(): - # type: () -> None +def foo()...

plugin

```sh $ cat foo.py from foo import bar # noqa: E402,F401 $ ruff --select F401 --add-noqa foo.py Added 1 noqa directives. $ cat foo.py from foo import bar # noqa:...

bug

``` print(1) from very_long_module\ import nothing # noqa: E402,F401 ``` doesn't detect `E402`

bug

```sh $ cat foo.py from foo import ( # noqa: F401 bar ) $ ruff --select F401 --add-noqa foo.py Added 1 noqa directives. $ cat foo.py from foo import (...

bug

ruff seems only to search for files with `.py` (maybe also `.pyi) file extensions?! it would be good to detect some certain hashbangs like: `!#/usr/bin/python` `!#/usr/bin/python3` `!#/usr/bin/python -b` `!#/usr/bin/env python3`...

cli

B007 unused-loop-control-variable revealed and fixed code like: ``` - for k, v in self.validation_errors.items(): + for _k, v in self.validation_errors.items(): num += v.number_of_errors() ``` a new checker could make it...

rule

``` for server, struct in self.versions(start, end, for_mirror_list): for struct.arch in sorted(struct.ARCHS): yield struct.deb(server) ``` is false-positive reported as B020 loop-variable-overrides-iterator.

question