summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-08-09 13:23:53 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-08-10 16:33:37 -0700
commitbf1072c9022cd161b9cc4860e5403a463bc0e05b (patch)
tree67c405d88312d151a65111fbece886084c706eef /share
parent8061deb883c84016f282f7e388c3c019af86b4ca (diff)
downloadspack-bf1072c9022cd161b9cc4860e5403a463bc0e05b.tar.gz
spack-bf1072c9022cd161b9cc4860e5403a463bc0e05b.tar.bz2
spack-bf1072c9022cd161b9cc4860e5403a463bc0e05b.tar.xz
spack-bf1072c9022cd161b9cc4860e5403a463bc0e05b.zip
Make Spack core PEP8 compliant.
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