Merge "Add global exclusions to dib-lint"

This commit is contained in:
Jenkins 2014-07-09 15:51:04 +00:00 committed by Gerrit Code Review
commit e93d365114

View File

@ -22,11 +22,25 @@ set -eu
set -o pipefail
parse_exclusions() {
# Exclusions are currently only read on a per-file basis
# Per-file exclusions
# Example: # dib-lint: disable=sete setpipefail
local filename=$1
local disable_pattern="# dib-lint: disable="
local exclusions=$(grep "^$disable_pattern.*$" $filename | sed "s/$disable_pattern//g")
echo $exclusions
# Global exclusions read from tox.ini
# Example section in tox.ini:
# [dib-lint]
# ignore = sete setu
section="dib-lint"
option="ignore"
global_exclusions=$(python -c \
"import ConfigParser; \
conf=ConfigParser.ConfigParser(); \
conf.read('tox.ini'); \
print conf.get('$section', '$option') if conf.has_option('$section', '$option') else ''"
)
echo $exclusions $global_exclusions
}
excluded() {