-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Violations plugin not showing code #17
Comments
I'm having the same issue. Maybe it's path related? |
Had a bit more time to investigate: The problem is that the path is wrong, it seems to ignore the Project Base Directory set in the project configuration. When I set up a job that does not use the Project Base Directory everything works fine. |
I'm seeing the same as in saily's issue -- I can see the source for my pep8 warnings, but not my jslint ones |
EDIT: actually, Pep8parser overrides getFileModel locally, which explains the differing paramaters The main difference I can see is that Pep8Parser does this:
while JsLintParser does this:
|
I get a similar issue with pep8 report: stat("/run/jenkins/war/job/operations-puppet-pep8/541/violations/file/files/ganglia/plugins/mysql.py", Though the workspace is in /var/lib/jenkins/job/operations-puppet-pep8/workspace and the mysql.py.xml report is at /var/lib/jenkins/jobs/operations-puppet-pep8/builds/541/violations/file/files/ganglia/plugins/mysql.py.xml The filename in the pep8 output is simply 'files/ganglia/plugins/mysql.py' |
Might be related to https://issues.jenkins-ci.org/browse/JENKINS-14291 |
I'm having the same issue on the Codenarc reporting. I get the following stack trace: This plugin is using a pretty old copy of xpp3 (version 1.1.3.3 from 2005). There is a less older 1.1.4c from 2007 that might help. |
Same issue for PMD and Findbugs. |
Sorry, PMD works fine, my bad. |
I believe that I bumped into similar problem. Also, this problem only happens when build is executed on windows (slave is on windows, master is on Linux), but it happens when both master and slave are on windows and does not happen when master and slave are on linux. I hope that this helps and that this will be fixed soon. |
@jochenberger |
I've abandoned the Violations plugin some time ago, but thanks for the hint. |
@jochenberger Do you have any plugin recommandation to replace its functionalities? |
I switched to using the stand-alone PMD and Findbugs plug-ins. |
I found the same problem using PyLint on Windows - the path separator "" seemed to be getting replaced with "/" by the browser, which meant the report file was never found. I've forked the violations plugin and made my own (very hacky, temporary) change to get it to work for me. Have a look here: https://github.com/CeeJayCee/violations-plugin/commit/ccbf77b2f49ecbb03950333e3e980500bb9183d6 |
I'm having the same issue with JSHint generated jslint.xml |
see https://issues.jenkins-ci.org/browse/JENKINS-17548 and pull request #33 perhaps this will work for others too? |
Thanks @delicb, that fixed it for me: |
This still seems to be an issue. When I click the link to go to the code, it goes to /jenkins/job/my_job_name/29/violations/file/src/main/modules/app.js/. Any update on getting this fixed? |
When I looked at he code, the violation plugin (or whatever other plugin it relies on) has terrible code with handling paths in the lint output. An absolute path in the output is actually relative to the workspace, and iirc it tries to account that by using the workspace path on the master instead of the one on the slave. I have quit using violation in favor of https://wiki.jenkins-ci.org/display/JENKINS/Checkstyle+Plugin |
Thanks for the info @hashar. My one concern in going solely to Checkstyle is that it didn't seem to support jshint reporting very well. I'll play with it some more and see - maybe I had something wrong in the config. |
For jshint you can pass it
function () {
alert("foo")
}
<?xml version="1.0" encoding="utf-8"?>
<checkstyle version="4.3">
<file name="bla.js">
<error line="1" column="10" severity="warning" message="Missing name in function declaration." source="jshint.W025" />
<error line="2" column="17" severity="warning" message="Missing semicolon." source="jshint.W033" />
</file>
</checkstyle> Or with unix reporter suitable for emacs:
|
@hashar, I was able to do something similar to that as well and it's working great. I'll end up going a custom route with the plugin due to the visual look/feel that they want. |
@atdiff jshint only accept a single reporter and always output to stdout so no. Potentially you could write your own reporter that would write two different formats. An example of a basic reporter is in the source code at https://github.com/jshint/jshint/blob/master/examples/reporter.js |
It needs to have the path relative to the working directory for the job. For pylint and pep8 you can augment the path printed in the analysis output using the format options, to fix the path issues for Violations plugin. Then it correctly shows the code with the style error messages popping up on hover. pep8 mymodule --format '/%(path)s:%(row)d:%(col)d: %(code)s %(text)s' |
When you drill down into the violations it should show the line of code in violation. However on our Jenkins install we see the violation graphs but selecting a file results in an empty page. Could it be that it cannot find the source code? How does it find the source code?
The text was updated successfully, but these errors were encountered: