How would I start integrating pyflakes with Hudson

守給你的承諾、 提交于 2019-12-05 04:39:56

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

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!