11

是否有内置方法可以将 pylint 报告保存到文件中?这样做似乎很有用,以便记录项目的进度并在进行更改时比较多个文件中的报告元素。

4

2 回答 2

12

你可以在你的shell中重定向它的输出> somefile.txt
如果它写入stderr,使用2>&1 > somefile.txt

于 2012-05-03T21:25:56.520 回答
12

注意:此选项已弃用,将在 Pylint 2.0 中删除。

您可以使用--file-output=y命令行选项。引用手册页:

   --files-output=<y_or_n>
          Put messages in a separate file for each module / package speci‐
          fied  on  the  command  line instead of printing them on stdout.
          Reports  (if   any)   will   be   written   in   a   file   name
          "pylint_global.[txt|html]". [current: no]

输出的格式由 --output-format=<format>选项指定,其中格式可以是text, parseable, colorized, msvs (visual studio) 和html.

于 2012-05-04T06:57:37.600 回答