Pylint with jenkins - agree I can't find the xml file

I am trying to run pylint with jenkins with the following command:

 pylint -f parseable -d I0011,R0801 "mypath\highLevel" | tee.exe pylint.out

      

The process looks fine, pylint.out is created with a lot of information inside, but while generating the pylint report I get the following error:

13:38:27 ERROR: Publisher hudson.plugins.violations.ViolationsPublisher aborted due to exception
13:38:27 java.io.FileNotFoundException: C:\Users\DMD\.jenkins\jobs\Diamond - Run Coverage\builds\2015-07-26_13-34-30\violations\file\A:\highLevel\Monitor\InitialBootAdapter.py.xml (The filename, directory name, or volume label syntax is incorrect)

      

This creates a very strange path:

C:\Users\DMD\.jenkins\jobs\Diamond - Run Coverage\builds\2015-07-26_13-34-30\violations\file\A:\highLevel\Monitor\InitialBootAdapter.py.xml

      

I do not understand what is going on. Why is pylint interested in the InitialBootAdapter.py file? Why is it looking for the InitialBootAdapter.py.xml file? Who should create it and why? I searched for this file all over the environment and couldn't find it. But I couldn't find xml for my other py files? Maybe you have experience with pylint and can help? Thank.

+3


source to share


2 answers


I fixed the issue, it took time and DevOps help, but it worked and is documented in my own blog (more my online notebook than a blog) in very small detail.

The most important point in this post is a small utility



import fileinput, sys

if __name__ == "__main__":
    for line in fileinput.FileInput(sys.argv[1], inplace=True):
        if ".cs"  in line:
            line = line.replace("\\", "/")
        print line,

      

The sys.argv[1]

path to your file should be here violations.xml

. You must transfer the path as a command line argument to the utility, since the path to your file violations.xml

is dynamic and depends on the assembly ID.

+1


source


I have experience with pylint in jenkins. And this is how I use it, hope it helps someone.

Step 1
Add an Execute pylint

Wrapper step and run the command to generate pylint.out. note

/usr/local/bin/pylint -f parseable -d I0011,R0801 my-python-project-folder | tee pylint.out

      



Step 2
Make sure you have the Violation Report Plugin , then click -> Add post-build action

Report Violation, put pylint.out in the appropriate field, enter image description here

And after running successfully, the pylint report looks like this: enter image description here

+6


source







All Articles