From 360b44c6cec8fc956adf92bc28c3a1bf01f1247f Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 2 Feb 2016 15:59:04 +0000 Subject: [PATCH] Resolve bashate violation E005 This patch implements changes required to resolve bashate violation E005 and also improves the tox config to improve the search for bash scripts in the repository. Change-Id: I4531126b850d54dc06e29bd9b5cf21fbff87bfd3 --- .../os_neutron/templates/plugins/plumgrid/pgrc | 2 +- tox.ini | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/playbooks/roles/os_neutron/templates/plugins/plumgrid/pgrc b/playbooks/roles/os_neutron/templates/plugins/plumgrid/pgrc index bbaa2cfdb7..3c67926504 100644 --- a/playbooks/roles/os_neutron/templates/plugins/plumgrid/pgrc +++ b/playbooks/roles/os_neutron/templates/plugins/plumgrid/pgrc @@ -1,5 +1,5 @@ -# {{ ansible_managed }} #!/bin/sh +# {{ ansible_managed }} export os_auth_url="{{ keystone_service_adminuri }}/v3" export os_admin_user="{{ keystone_admin_user_name }}" export os_admin_tenant="{{ keystone_admin_tenant_name }}" diff --git a/tox.ini b/tox.ini index 1ec7fa59fe..756a668949 100644 --- a/tox.ini +++ b/tox.ini @@ -55,17 +55,12 @@ commands = # Run bashate check for all bash scripts # Ignores the following rules: # E003: Indent not multiple of 4 (we prefer to use multiples of 2) - # E005: File does not begin with #! or have .sh prefix # E006: Line longer than 79 columns - bash -c "grep -Irl \ - -e '!/usr/bin/env bash' \ - -e '!/bin/bash' \ - -e '!/bin/sh' \ - --exclude-dir '.*' \ - --exclude-dir '*.egg' \ - --exclude-dir '*.egg-info' \ - --exclude 'tox.ini' \ - {toxinidir} | xargs bashate --verbose --ignore=E003,E005,E006" + bash -c "grep --recursive --binary-files=without-match \ + --files-with-match '^.!.*\(ba\)\?sh$' \ + --exclude-dir .tox \ + --exclude-dir .git \ + {toxinidir} | xargs bashate --error . --verbose --ignore=E003,E006" [testenv:ansible-lint] deps =