Skip to content

Commit 68807aa

Browse files
committed
Add a flake8 configuration
Not running it on CI or anything, just for developers who want to run it locally.
1 parent 522b004 commit 68807aa

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

examples/trio-server.py

+3
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,16 @@
8383

8484
import h11
8585

86+
8687
MAX_RECV = 2 ** 16
8788
TIMEOUT = 10
8889

90+
8991
################################################################
9092
# I/O adapter: h11 <-> trio
9193
################################################################
9294

95+
9396
# The core of this could be factored out to be usable for trio-based clients
9497
# too, as well as servers. But as a simplified pedagogical example we don't
9598
# attempt this here.

h11/_connection.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
# - Apache: <8 KiB per line>
3333
DEFAULT_MAX_INCOMPLETE_EVENT_SIZE = 16 * 1024
3434

35+
3536
# RFC 7230's rules for connection lifecycles:
3637
# - If either side says they want to close the connection, then the connection
3738
# must close.
@@ -501,7 +502,7 @@ def send_with_data_passthrough(self, event):
501502
data_list = []
502503
writer(event, data_list.append)
503504
return data_list
504-
except:
505+
except BaseException:
505506
self._process_error(self.our_role)
506507
raise
507508

h11/tests/test_events.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def test_intenum_status_code():
161161

162162
r = Response(status_code=HTTPStatus.OK, headers=[], http_version="1.0")
163163
assert r.status_code == HTTPStatus.OK
164-
assert type(r.status_code) is not type(HTTPStatus.OK)
164+
assert type(r.status_code) is not type(HTTPStatus.OK) # noqa: F721
165165
assert type(r.status_code) is int
166166

167167

setup.cfg

+10
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ line_length=88
1111
multi_line_output=3
1212
no_lines_before=LOCALFOLDER
1313
order_by_type=False
14+
15+
[flake8]
16+
max-line-length = 88
17+
extend-ignore =
18+
# 'from .foo import *' used; unable to detect undefined names
19+
F403
20+
# 'Foo' may be undefined, or defined from star import: foo
21+
F405
22+
# whitespace before ':'
23+
E203

0 commit comments

Comments
 (0)