问题
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