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

狂风中的少年 提交于 2019-12-04 11:55:43

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.

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.

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.

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