Running pylint against only changed lines/files with jenkins
At this time, I am using the violations plugin with Jenkins to generate a report of PEP8 violations. Since I am only beginning to use this check, there are an insane number of violations. So I’d like to start with only checking what changed in a pull request.
I use this command in order to generate my current pylint report for jenkins
pylint -f parseable ‘/var/lib/ci_server/workspace/pylint_check’ | tee pylint.out
The above command will scan the entire project rather than just changes in the pull request.
I’ve also tried using this:
git diff-index —name-only HEAD | grep .py | xargs pylint -f pylint -f parseable | tee pylint.out
^ This command runs the build, but yields 0 violations on my pull request… It looks like that my pull requests show up in a detached HEAD sort of state (I assume git diff no longer works in this context?)
The overall goal here is to scan for style violations within changes in a pull request using Jenkins… I’ve been pulling my hair over this for a couple days now. Any help would be super great, cheers!
One Solution collect form web for “Running pylint against only changed lines/files with jenkins”
git-lint. It seems to do what you’re looking to accomplish.