PEP8在特定行之间

huangapple go评论57阅读模式
英文:

PEP8 between specific lines

问题

我有一些在我的代码库中的巨大文件,其中存在许多与pep8相关的问题。

是否有办法分析与pep8相关的特定行?

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

这样我就可以分析代码的特定部分了?

英文:

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

得分: 1

我不认为pep8中有这个内置功能,但你可以通过将pep8与终端工具如sed结合使用来实现此目标:

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

在这种情况下,sed的输出(文件的第100行到第200行)被用作pep8的输入。

英文:

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

huangapple
  • 本文由 发表于 2023年5月24日 19:33:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76323081.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定