From 512068a095a2bc79d4c0088af0651cbb500a1702 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 8 Oct 2019 12:56:09 +0200 Subject: [PATCH 1/5] Limit ignored builtins to what is actually used --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 1d582c448789..d5140fa877e7 100644 --- a/.flake8 +++ b/.flake8 @@ -20,6 +20,6 @@ ignore = F401, F403, F405, F811, E301, E302, E305, E501, E701, E704, E741, B303, # We are checking with Python 3 but many of the stubs are Python 2 stubs. # A nice future improvement would be to provide separate .flake8 # configurations for Python 2 and Python 3 files. -builtins = StandardError,apply,basestring,buffer,cmp,coerce,execfile,file,intern,long,raw_input,reduce,reload,unichr,unicode,xrange +builtins = buffer,file,long,unicode,xrange exclude = .venv*,@*,.git max-line-length = 130 From 4a91dc096f13ec547e35855e2ce3fb68f50afa95 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 8 Oct 2019 12:58:41 +0200 Subject: [PATCH 2/5] Update flake8-bugbear --- requirements-tests-py3.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests-py3.txt b/requirements-tests-py3.txt index 34c3a46716aa..e5e3ba7da6d9 100644 --- a/requirements-tests-py3.txt +++ b/requirements-tests-py3.txt @@ -2,7 +2,7 @@ git+https://github.com/python/mypy.git@master typed-ast>=1.0.4 black==19.3b0 flake8==3.7.8 -flake8-bugbear==19.3.0 +flake8-bugbear==19.8.0 flake8-pyi==19.3.0 isort==4.3.21 pytype>=2019.7.30 From f25ae03641813fcd709fb6105209ed439e5178b3 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 8 Oct 2019 13:41:17 +0200 Subject: [PATCH 3/5] Add a comment about an upcoming fix --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index d5140fa877e7..1e698154b546 100644 --- a/.flake8 +++ b/.flake8 @@ -5,7 +5,7 @@ # 7155 E302 expected 2 blank lines # 1463 F401 imported but unused # 967 E701 multiple statements on one line (colon) -# 457 F811 redefinition +# 457 F811 redefinition (should be fixed in pyflakes 2.1.2) # 390 E305 expected 2 blank lines # 4 E741 ambiguous variable name From 649c78798a539a792f9216ca4a4ec6a27e02c7e0 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 8 Oct 2019 17:11:46 +0200 Subject: [PATCH 4/5] Re-add builtins list --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 1e698154b546..31ea41e389d2 100644 --- a/.flake8 +++ b/.flake8 @@ -20,6 +20,6 @@ ignore = F401, F403, F405, F811, E301, E302, E305, E501, E701, E704, E741, B303, # We are checking with Python 3 but many of the stubs are Python 2 stubs. # A nice future improvement would be to provide separate .flake8 # configurations for Python 2 and Python 3 files. -builtins = buffer,file,long,unicode,xrange +builtins = StandardError,apply,basestring,buffer,cmp,coerce,execfile,file,intern,long,raw_input,reduce,reload,unichr,unicode,xrange exclude = .venv*,@*,.git max-line-length = 130 From 35801be066ee795cbe1be0376806aca76ae8e9d2 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 8 Oct 2019 17:12:49 +0200 Subject: [PATCH 5/5] Remove impossible comment --- .flake8 | 2 -- 1 file changed, 2 deletions(-) diff --git a/.flake8 b/.flake8 index 31ea41e389d2..362deab3ccf9 100644 --- a/.flake8 +++ b/.flake8 @@ -18,8 +18,6 @@ [flake8] ignore = F401, F403, F405, F811, E301, E302, E305, E501, E701, E704, E741, B303, W504 # We are checking with Python 3 but many of the stubs are Python 2 stubs. -# A nice future improvement would be to provide separate .flake8 -# configurations for Python 2 and Python 3 files. builtins = StandardError,apply,basestring,buffer,cmp,coerce,execfile,file,intern,long,raw_input,reduce,reload,unichr,unicode,xrange exclude = .venv*,@*,.git max-line-length = 130