Skip to content

Instantly share code, notes, and snippets.

@yangboz
Created June 29, 2015 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yangboz/238cbc292f6a611a543e to your computer and use it in GitHub Desktop.
Save yangboz/238cbc292f6a611a543e to your computer and use it in GitHub Desktop.
Ant Pylint with Jenkins
<!--
@ref: http://chrigl.de/blogentries/integration-of-pylint-into-jenkins
@ref: http://redsolo.blogspot.com/2007/11/hudson-embraces-python.html
@more: http://bitten.edgewall.org/wiki/Documentation/commands.html
-->
<project default="all" basedir="../">
<!--
Define an environment variable pointing to PyLint folder or change this
-->
<property environment="env"/>
<property name="src.python" location="./"/>
<property name="pylint.binary" location="/usr/local/bin/pylint"/>
<property name="report.pylint" location="./pylint.log"/>
<!-- @ref: http://redsolo.blogspot.com/2007/11/hudson-embraces-python.html -->
<target name="clean">
<delete dir="results"/>
<delete file="pylint.log"/>
</target>
<target name="report-pylint" depends="clean">
<exec dir="${src.python}" executable="${pylint.binary}" output="${report.pylint}">
<env key="PYTHONPATH" path="${build.bin}:${build.bin}/lib/"/>
<arg line="-f parseable -i y **/*.py --output-format=parseable --ignore-comments=y --min-similarity-lines=4 --disable-msg=R0903 --disable-msg=C0301"/>
</exec>
</target>
<target name="all" depends="report-pylint"/>
</project>