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.
When a pull request is opened, I use the github pull request builder in order to test the pull request, and I'd also like to check the styling using pylint (or equivalent) as well.
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!
Check out git-lint
. It seems to do what you're looking to accomplish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With