IMPALA-7317: loosen flake8 rules

I got feedback that the flake8 rules are a little too strict, so based
on the dev@impala.apache.org discussion am disabling some of them.

I left E302 "expected 2 blank lines, found 1" enabled since I think it
would force our formatting to be more consistent, but I'm open to
changing that.

I used the following command to get a sense of the number of existing
violations:

  EXCLUDES=ext-py,shell/build,gerrit_critic_venv,infra/python/env
  EXCLUDES+=,shell/pkg_resources.py,shell/thrift_sasl.py,gen-py
  EXCLUDES+=,TPC-DS-master,toolchain
  ./bin/impala-flake8 --exclude=${EXCLUDES}

Change-Id: Iaaa8377025e732231ac0f1f1f2db67298a171997
Reviewed-on: http://gerrit.cloudera.org:8080/11102
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Tim Armstrong <tarmstrong@cloudera.com>
This commit is contained in:
Tim Armstrong
2018-07-31 00:10:36 -07:00
parent 55083f38cc
commit 87b02e7332
2 changed files with 7 additions and 3 deletions

View File

@@ -65,7 +65,8 @@ SOURCE_EXTENSIONS = set([".cc", ".h", ".java", ".py", ".sh", ".thrift"])
EXCLUDE_FILE_PATTERNS = [
re.compile(r".*be/src/kudu.*"), # Kudu source code may have different rules.
re.compile(r".*-benchmark.cc"), # Benchmark files tend to have long lines.
re.compile(r".*/function-registry/impala_functions.py") # Many long strings.
re.compile(r".*/function-registry/impala_functions.py"), # Many long strings.
re.compile(r".*/shell/ext-py/*") # Third-party code.
]

View File

@@ -15,8 +15,11 @@
# specific language governing permissions and limitations
# under the License.
[flake8]
# These are ignored in order to support 2-space indents.
# E111,E114: These are ignored in order to support 2-space indents.
# E121,E125,E127,E128: ignored to allow some of the more common idioms for multi-line
# statement indentation used in the Impala code.
# E701: ignored to allow if statement body on same line as conditional
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
ignore = E111,E114
ignore = E111,E114,E121,E125,E127,E128,E701
# Change from default to conform to Apache Impala line length.
max-line-length = 90