Skip to content

Commit

Permalink
Ignore flake8 E701/704 because it conflicts with recent black
Browse files Browse the repository at this point in the history
  • Loading branch information
ktns committed Mar 21, 2024
1 parent 70b2010 commit 6d77d23
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pysen/ext/flake8_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ 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(
# cf. https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#e701-e704
"# E701: black will collapse implementations of classes and functions consisting solely of ... to a single line"
)

if not _contains(new.ignore, "E704"):
new.ignore.append("E704")
new._comments.append(
# cf. https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#e701-e704
"# E704: black will collapse implementations of classes and functions consisting solely of ... to a single line"
)

W503_or_504_enabled = _contains(new.ignore, "W503") or _contains(
new.ignore, "W504"
)
Expand Down

0 comments on commit 6d77d23

Please sign in to comment.