diff options
author | Nigel Babu <nigelb@redhat.com> | 2018-07-06 12:09:32 +0530 |
---|---|---|
committer | Nigel Babu <nigelb@redhat.com> | 2018-08-02 12:07:44 +0000 |
commit | 9bec9c5e379a99509aaa5291b5dc2ef107f906e5 (patch) | |
tree | dd0925d65c56c7355da0ed36bd4b24610c07165e | |
parent | 8f78059bccffb35ce419eec16b4a79c222ab281a (diff) |
Add a job for python3 compliance
Change-Id: Ia3c773462fedc2b331c5de5431b3f4b428f0b3ef
-rw-r--r-- | build-gluster-org/jobs/python-compliance.yml | 35 | ||||
-rw-r--r-- | build-gluster-org/scripts/python-compliance.sh | 4 |
2 files changed, 39 insertions, 0 deletions
diff --git a/build-gluster-org/jobs/python-compliance.yml b/build-gluster-org/jobs/python-compliance.yml new file mode 100644 index 0000000..5b20bf2 --- /dev/null +++ b/build-gluster-org/jobs/python-compliance.yml @@ -0,0 +1,35 @@ +- job: + name: python-compliance + node: smoke7 + description: Check for python3 compliance + project-type: freestyle + concurrent: true + + scm: + - glusterfs + + properties: + - discard-after-x: + x: 10 + - one-build-per-node + + parameters: + - string: + default: refs/heads/master + description: 'For review 12345 and patch set 6, this will be refs/changes/45/12345/6. Default: Tip of master' + name: GERRIT_REFSPEC + - string: + default: master + description: 'Name of the branch you want to build from. We usually build from master' + name: GERRIT_BRANCH + + builders: + - shell: !include-raw: ../scripts/python-compliance.sh + + wrappers: + - timestamps + - timeout: + timeout: 30 + abort: true + type: absolute + diff --git a/build-gluster-org/scripts/python-compliance.sh b/build-gluster-org/scripts/python-compliance.sh new file mode 100644 index 0000000..532170c --- /dev/null +++ b/build-gluster-org/scripts/python-compliance.sh @@ -0,0 +1,4 @@ +#!/usr/bin/bash +grep -rnl '#!/usr/bin/python' | xargs pylint-3 --py3k +find . -name '*.py' | xargs pylint-3 --py3k +find . -name '*.in' | xargs file | grep 'Python' | awk '{print $1}' | cut -d: -f 1 | xargs pylint-3 --py3k |