summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorbecker33 <becker33@llnl.gov>2016-08-10 17:36:31 -0700
committerGitHub <noreply@github.com>2016-08-10 17:36:31 -0700
commitf59653ac2c9b20ec5954d90fda019c7652644ac9 (patch)
treeb0d6767d3a5c257ca2f75db31f81af84f4b082d9 /share
parent8061deb883c84016f282f7e388c3c019af86b4ca (diff)
parent84e331c58618f2c67da00cbc56f51c75bd61af91 (diff)
downloadspack-f59653ac2c9b20ec5954d90fda019c7652644ac9.tar.gz
spack-f59653ac2c9b20ec5954d90fda019c7652644ac9.tar.bz2
spack-f59653ac2c9b20ec5954d90fda019c7652644ac9.tar.xz
spack-f59653ac2c9b20ec5954d90fda019c7652644ac9.zip
Merge pull request #1496 from LLNL/features/pep8-compliance
PEP8 compliance
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/qa/run-flake817
1 files changed, 13 insertions, 4 deletions
diff --git a/share/spack/qa/run-flake8 b/share/spack/qa/run-flake8
index 595df417ec..c59bfc9490 100755
--- a/share/spack/qa/run-flake8
+++ b/share/spack/qa/run-flake8
@@ -22,9 +22,13 @@ changed=$(git diff --name-only --find-renames develop... | grep '.py$')
# Add approved style exemptions to the changed packages.
for file in $changed; do
- if [[ $file = *package.py ]]; then
- cp "$file" "$file~"
+ # Make a backup to restore later
+ cp "$file" "$file.sbak~"
+ #
+ # Exemptions for package.py files
+ #
+ if [[ $file = *package.py ]]; then
# Exempt lines with urls and descriptions from overlong line errors.
perl -i -pe 's/^(\s*homepage\s*=.*)$/\1 # NOQA: ignore=E501/' $file
perl -i -pe 's/^(\s*url\s*=.*)$/\1 # NOQA: ignore=E501/' $file
@@ -36,6 +40,11 @@ for file in $changed; do
# Exempt '@when' decorated functions from redefinition errors.
perl -i -pe 's/^(\s*\@when\(.*\).*)$/\1 # NOQA: ignore=F811/' $file
fi
+
+ #
+ # Exemptions for all files
+ #
+ perl -i -pe 's/^(.*(https?|file)\:.*)$/\1 # NOQA: ignore=E501/' $file
done
return_code=0
@@ -58,8 +67,8 @@ fi
# Restore original package files after modifying them.
for file in $changed; do
- if [[ $file = *package.py ]]; then
- mv "${file}~" "${file}"
+ if [[ -e "${file}.sbak~" ]]; then
+ mv "${file}.sbak~" "${file}"
fi
done