summaryrefslogtreecommitdiff
path: root/.flake8_packages
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-10-23 14:57:46 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2017-10-24 10:05:36 +0200
commit7757ebc0bc5b46cb3cfa41e5bebd4754978fd3b0 (patch)
tree2fdefbf27a3b392aedb6323d013bb842c8fe304c /.flake8_packages
parentbeab0cb92e61ba4e33124ff17f244c121973117d (diff)
downloadspack-7757ebc0bc5b46cb3cfa41e5bebd4754978fd3b0.tar.gz
spack-7757ebc0bc5b46cb3cfa41e5bebd4754978fd3b0.tar.bz2
spack-7757ebc0bc5b46cb3cfa41e5bebd4754978fd3b0.tar.xz
spack-7757ebc0bc5b46cb3cfa41e5bebd4754978fd3b0.zip
flake8: no wildcards in core; only `import *` from spack in packages
There are now separate flake8 configs for core vs. packages: - core has a smaller set of flake8 exceptions - packages allow `from spack import *` and module globals - Allows core to take advantage of static checking for undefined names - Allows packages to keep using Spack tricks like `from spack import *` and dependencies setting globals for dependents.
Diffstat (limited to '.flake8_packages')
-rw-r--r--.flake8_packages22
1 files changed, 22 insertions, 0 deletions
diff --git a/.flake8_packages b/.flake8_packages
new file mode 100644
index 0000000000..9fcc3b86d4
--- /dev/null
+++ b/.flake8_packages
@@ -0,0 +1,22 @@
+# -*- conf -*-
+# flake8 settings for Spack package files.
+#
+# This should include all the same exceptions that we use for core files.
+#
+# In Spack packages, we also allow the single `from spack import *`
+# wildcard import and dependencies can set globals for their
+# dependents. So we add exceptions for checks related to undefined names.
+#
+# Note that we also add *per-line* exemptions for certain patters in the
+# `spack flake8` command. This is where F403 for `from spack import *`
+# is added (beause we *only* allow that wildcard).
+#
+# See .flake8 for regular exceptions.
+#
+# Redefinition exceptions:
+# - F405: `name` may be undefined, or undefined from star imports: `module`
+# - F821: undefined name `name` (needed for cmake, configure, etc.)
+#
+[flake8]
+ignore = E129,E221,E241,E272,E731,F999,F405,F821
+max-line-length = 79