PEP8 between specific lines

50 Views Asked by At

I have some huge files in my codebase which have many pep8 related issues.

Is there any way to analyze specific lines with pep8

pep8 input /path/to/my-code.py --lines=100-200

So that I can analyze specific part of the code?

1

There are 1 best solutions below

0
David On BEST ANSWER

I don't think there is a built-in feature in pep8 for this, but you can achieve this by combining pep8 with a terminal tool such as sed:

sed -n '100,200p' /path/to/my-code.py | pep8 input -

In this case the output of sed (line 100 to line 200 of your file) is used as the input of pep8