Closed tushar-deepsource closed 1 year ago
this is correct. the docstring should use spaces too
there's also a bunch of duplicates -- they are all tagged by the error code so please search that next time!
It is correct, but it's really bad UX imo.
I'll give you a valid usecase: someone was using tabs, then ran the codebase through black
. now everything is spaces except the docstrings, and pycodestyle raises thousands issues on lines of code, even though all code is indented with 4 spaces.
still doesn't sound like a pycodestyle problem -- sounds like someone wants to run git ls-files -- '*.py' | xargs sed -i 's/\t/ /g'
If the docstring has indentation with tabs, and the code is indented with spaces (or vice versa), then E101 is raised on every single indented line of the codebase.
For example:
I guess this can be fixed by not treating the indentation inside docstrings as the de-facto, rather using the first
INDENT
token. Logic here: https://github.com/PyCQA/pycodestyle/blob/d4dadf593e56f5b969b206e80ae2923f8bfd30b8/pycodestyle.py#L1987