Florian Best
Florian Best
yes, this is kind of my current workaround.
This workaround would also be needed in a pre-commit hook, where I did not yet find out how to achieve it.
ok, `pre-commit` already supports it: it first searches for files with `.py`[`i`] extension and then for executable files with common python hashbangs.
hm, #3914 closed it but this allows only files with a specific extension. our files/scripts don't have any file extension.
could be identified and fixed by `SIM110` instead of `SIM111` then.
I also wondered what `T201` is about. I don't understand its purpose. This maybe makes sense for a library. I aksed that upstream in https://github.com/JBKahn/flake8-print/issues/59.
a quick workaround python script to achieve it: ``` import sys import subprocess lines = [line.split(':') for line in subprocess.check_output(['ruff', '-e', '--select', 'PLR0402', *sys.argv[1:]]).decode().splitlines()] lines = [line for line in...
> You're likely to end up with duplicates like that if there are multiple violations in a file. So you'd want another flag to avoid duplicate rows, or have `ruff`...
https://github.com/asottile/pyupgrade/issues/791
it separates the import lines from every following. e.g. with `lines-after-imports=2` you prevent `E302` from happening.