Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flake8 configuration #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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