From 81cb5ad06edb6c0c62b655fc59d4bafda862d4f9 Mon Sep 17 00:00:00 2001 From: Katsuhiko Nishimra Date: Thu, 21 Mar 2024 21:23:42 +0900 Subject: [PATCH] Ignore flake8 E701/704 because it conflicts with recent black (#48) * Ignore flake8 E701/704 because it conflicts with recent black * Shorter comments * fix a typo --- pysen/ext/flake8_wrapper.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pysen/ext/flake8_wrapper.py b/pysen/ext/flake8_wrapper.py index f2e4de9..5fd8fb7 100644 --- a/pysen/ext/flake8_wrapper.py +++ b/pysen/ext/flake8_wrapper.py @@ -66,6 +66,18 @@ def to_black_compatible(self) -> "Flake8Setting": "# E501: black may exceed the line-length to follow other style rules" ) + if not _contains(new.ignore, "E701"): + new.ignore.append("E701") + new._comments.append( + "# E701: black will collapse ... only functions etc. to a single line" + ) + + if not _contains(new.ignore, "E704"): + new.ignore.append("E704") + new._comments.append( + "# E704: black will collapse ... only functions etc. to a single line" + ) + W503_or_504_enabled = _contains(new.ignore, "W503") or _contains( new.ignore, "W504" )