Is it possible to see the source code of the violating files in Hudson with Violations and Pylint?

本秂侑毒 提交于 2019-12-06 06:43:40

问题


I'm using Hudson CI with a Python project. I've installed the Violations plugin and configured it to run the code against pylint. This works, but I only see a list of violations without linking to the source code. Is it possible to setup Violations and pylint to load and highlight the violating source files (something similar to the Cobertura Coverage Reports)?

Better yet, can Violations integrate with pep8.py?


回答1:


Well, after some more debugging, I realized that the pylint output file referenced the source code files relative to where pylint was being run, which wasn't the same path that Hudson needed. Basically, Violations needed the paths relative to the Hudson workspace.




回答2:


I ran into a similar problem with pylint and violations. For me, the problem was that pylint writes absolute file names to the results file, while the violations plugin expects paths relative to the workspace directory. Running this sed one-liner on the pylint output file fixed my problem:

sed -i s#.*workspace/## pylint-hudson.txt

I also filed a bug against Hudson.




回答3:


Better yet, can Violations integrate with pep8.py?

This should probably be a separate question but I'll answer it anyway: I adapted the pylint parser into a pep8 parser for Hudson's Violations plugin. See this ticket for the patch:

http://issues.hudson-ci.org/browse/HUDSON-7728

It has been working fine for me.



来源:https://stackoverflow.com/questions/2502345/is-it-possible-to-see-the-source-code-of-the-violating-files-in-hudson-with-viol

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