summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-05-17 17:00:49 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-05-17 17:00:49 -0700
commitd592a1655f8e5dbb02f366c01dd5e05eed98301e (patch)
treebee1c81a2468fe308704bb76e290c759465234da /share
parent502420ceff7214d11b6956d42f44f22cc8c6ca6e (diff)
parent761c5c845072f2079acaab886aac197798d9fd25 (diff)
downloadspack-d592a1655f8e5dbb02f366c01dd5e05eed98301e.tar.gz
spack-d592a1655f8e5dbb02f366c01dd5e05eed98301e.tar.bz2
spack-d592a1655f8e5dbb02f366c01dd5e05eed98301e.tar.xz
spack-d592a1655f8e5dbb02f366c01dd5e05eed98301e.zip
Merge pull request #961 from xjrc/features/flake8-improvements
Enhancement Proposal: Exempt '@when' Functions from Style Redefinition Errors
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/qa/run-flake812
1 files changed, 10 insertions, 2 deletions
diff --git a/share/spack/qa/run-flake8 b/share/spack/qa/run-flake8
index 722c7fcba6..44eb0167fb 100755
--- a/share/spack/qa/run-flake8
+++ b/share/spack/qa/run-flake8
@@ -20,10 +20,18 @@ fi
# Check if changed files are flake8 conformant [framework]
changed=$(git diff --name-only develop... | grep '.py$')
-# Exempt url lines in changed packages from overlong line errors.
+# Add approved style exemptions to the changed packages.
for file in $changed; do
if [[ $file = *package.py ]]; then
- perl -i~ -pe 's/^(\s*url\s*=.*)$/\1 # NOQA: ignore=E501/' $file;
+ cp "$file" "$file~"
+
+ # Exempt lines with urls and descriptions from overlong line errors.
+ perl -i -pe 's/^(\s*url\s*=.*)$/\1 # NOQA: ignore=E501/' $file
+ perl -i -pe 's/^(\s*version\(.*\).*)$/\1 # NOQA: ignore=E501/' $file
+ perl -i -pe 's/^(\s*variant\(.*\).*)$/\1 # NOQA: ignore=E501/' $file
+
+ # Exempt '@when' decorated functions from redefinition errors.
+ perl -i -pe 's/^(\s*\@when\(.*\).*)$/\1 # NOQA: ignore=F811/' $file
fi
done