From aa90148b1830a315cb0cdfdded5972fa590073b4 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Mon, 11 May 2020 22:47:55 +0000 Subject: [PATCH 1/2] testing: remove I100 and I201 from the ignore list These are added in: https://github.com/GoogleCloudPlatform/python-docs-samples/pull/1770 --- noxfile-template.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/noxfile-template.py b/noxfile-template.py index 9f2242194ce..178ad5cc381 100644 --- a/noxfile-template.py +++ b/noxfile-template.py @@ -34,10 +34,6 @@ # -# Ignore I202 "Additional newline in a section of imports." to accommodate -# region tags in import blocks. Since we specify an explicit ignore, we also -# have to explicitly ignore the list of default ignores: -# `E121,E123,E126,E226,E24,E704,W503,W504` as shown by `flake8 --help`. def _determine_local_import_names(start_dir): """Determines all import names that should be considered "local". @@ -54,13 +50,23 @@ def _determine_local_import_names(start_dir): ] +# Linting with flake8. +# +# We ignore the following rules: +# E203: whitespace before ‘:’ +# E266: too many leading ‘#’ for block comment +# E501: line too long +# I202: Additional newline in a section of imports +# +# We also need to specify the default rules which are ignored: +# ['E226', 'W504', 'E126', 'E123', 'W503', 'E24', 'E704', 'E121'] FLAKE8_COMMON_ARGS = [ "--show-source", "--builtin=gettext", "--max-complexity=20", "--import-order-style=google", "--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py", - "--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I100,I201,I202", + "--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202", "--max-line-length=88", ] From 239942849aeee94cd58ecc67f67653bbba763783 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Mon, 11 May 2020 22:52:48 +0000 Subject: [PATCH 2/2] better comment --- noxfile-template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile-template.py b/noxfile-template.py index 178ad5cc381..ed35a8a8484 100644 --- a/noxfile-template.py +++ b/noxfile-template.py @@ -58,7 +58,7 @@ def _determine_local_import_names(start_dir): # E501: line too long # I202: Additional newline in a section of imports # -# We also need to specify the default rules which are ignored: +# We also need to specify the rules which are ignored by default: # ['E226', 'W504', 'E126', 'E123', 'W503', 'E24', 'E704', 'E121'] FLAKE8_COMMON_ARGS = [ "--show-source",