Skip to content

Commit

Permalink
Add a flake8 configuration
Browse files Browse the repository at this point in the history
Not running it on CI or anything, just for developers who want to run it
locally.
  • Loading branch information
bluetech committed Nov 18, 2020
1 parent 522b004 commit df32b62
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions examples/trio-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@
MAX_RECV = 2 ** 16
TIMEOUT = 10


################################################################
# I/O adapter: h11 <-> trio
################################################################


# The core of this could be factored out to be usable for trio-based clients
# too, as well as servers. But as a simplified pedagogical example we don't
# attempt this here.
Expand Down
3 changes: 2 additions & 1 deletion h11/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
# - Apache: <8 KiB per line>
DEFAULT_MAX_INCOMPLETE_EVENT_SIZE = 16 * 1024


# RFC 7230's rules for connection lifecycles:
# - If either side says they want to close the connection, then the connection
# must close.
Expand Down Expand Up @@ -501,7 +502,7 @@ def send_with_data_passthrough(self, event):
data_list = []
writer(event, data_list.append)
return data_list
except:
except BaseException:
self._process_error(self.our_role)
raise

Expand Down
2 changes: 1 addition & 1 deletion h11/tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_intenum_status_code():

r = Response(status_code=HTTPStatus.OK, headers=[], http_version="1.0")
assert r.status_code == HTTPStatus.OK
assert type(r.status_code) is not type(HTTPStatus.OK)
assert type(r.status_code) is not type(HTTPStatus.OK) # noqa: F721
assert type(r.status_code) is int


Expand Down
10 changes: 10 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ line_length=88
multi_line_output=3
no_lines_before=LOCALFOLDER
order_by_type=False

[flake8]
max-line-length = 88
extend-ignore =
# 'from .foo import *' used; unable to detect undefined names
F403
# 'Foo' may be undefined, or defined from star import: foo
F405
# whitespace before ':'
E203

0 comments on commit df32b62

Please sign in to comment.