我将如何开始将 pyflakes 与 Hudson 集成

发布于 2024-08-24 19:06:15 字数 117 浏览 3 评论 0原文

我们使用 Hudson 与 Violations 插件进行持续集成,该插件解析 pylint 的输出。然而,pylint 有点过于严格,并且难以配置。我们更愿意使用 pyflakes,它会给我们正确的“你做错了”的级别。

We use Hudson for continuous integration with the Violations Plugin which parses our output from pylint. However, pylint is a bit too strict, and hard to configure. What we'd rather use is pyflakes which would give us the right level of "You're doing it wrong."

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

俯瞰星空 2024-08-31 19:06:15

您可以调整 pyflakes 和 pep8 输出以与 Violations pylint 插件配合使用。

pyflakes path/to/src | awk -F\: '{printf "%s:%s: [E]%s\n", $1, $2, $3}' > violations.pyflakes.txt

pep8 path/to/src | awk -F\: '{printf "%s:%s: [%s]%s\n", $1, $2, substr($4,2,4), substr($4,6)}' > violations.pep8.txt

您可以使用正则表达式或连接输出来生成包含多个指标的报告。

有关更多详细信息,请参阅 http://hustoknow.blogspot.com/2011 /01/integration-pyflakes-into-hudson.html

You can adapt pyflakes and pep8 output to work with the Violations pylint plugin.

pyflakes path/to/src | awk -F\: '{printf "%s:%s: [E]%s\n", $1, $2, $3}' > violations.pyflakes.txt

pep8 path/to/src | awk -F\: '{printf "%s:%s: [%s]%s\n", $1, $2, substr($4,2,4), substr($4,6)}' > violations.pep8.txt

You could use a regex or concatenate the output to generate a report that includes multiple metrics.

For more details see http://hustoknow.blogspot.com/2011/01/integration-pyflakes-into-hudson.html

夏尔 2024-08-31 19:06:15

Violations 插件需要来自它支持的各种检查器的 xml 输出。

我不熟悉 pyflakes,但从我的简短扫描来看,它似乎不支持 xml 作为输出类型。因此,在让 Violations 尝试解析它之前,您必须对 pyflakes 输出进​​行后处理(或者您可以修改 pyflakes 并编写自己的消息输出类)。您可能想要捕获 pylint 输出并使用它来找出 Violations 插件喜欢的适当 xml 格式。

The Violations plugin requires xml output from the various checkers that it supports.

I'm not familiar with pyflakes, but from my brief scan, it doesn't appear to support xml as an output type. So you'll have to post-process the pyflakes output before letting Violations try to parse it (or you could modify pyflakes and write your own Message output class). You'll probably want to capture the pylint output and use that to figure out the appropriate xml format that the Violations plugin likes.

你与清晨阳光 2024-08-31 19:06:15

Violations 插件需要各种检查器的 xml 输出

这是错误的:一些检查器(例如“checkstyle”)输出 XML,另一些检查器(例如“pylint”和“pep8”)输出“文本”文件,每行一条记录。 Jenkins“XML 文件名模式”中的标题明显具有误导性。

The Violations plugin requires xml output from the various checkers

This is wrong: Some checkers like "checkstyle" output XML, some others like "pylint" and "pep8" output "text" files with one record per line. The heading in Jenkins "XML filename pattern" is plain misleading.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文