Skip to content

Commit d43ca70

Browse files
committedApr 15, 2025··
MNT: flake8: fix E704, E226; ignore F824, W503, W504
1 parent ef0fbea commit d43ca70

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed
 

‎pdoc/test/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def test_lunr_search(self):
289289
file_pattern='example_pkg/subpkg/index.html')
290290
# Only build lunr search when --html
291291
with redirect_streams() as (_, stderr):
292-
run(EXAMPLE_MODULE, config='lunr_search={"fuzziness": 1}')
292+
run(EXAMPLE_MODULE, config='lunr_search={"fuzziness": 1}')
293293
self.assertFalse(stderr.read())
294294

295295
def test_force(self):
@@ -898,7 +898,7 @@ class Foo(enum.Enum):
898898
self.assertEqual(func.params(link=lambda x: ''), ['a=<object object>'])
899899

900900
# typed
901-
def f(a: int, *b, c: typing.List[pdoc.Doc] = []): pass
901+
def f(a: int, *b, c: typing.List[pdoc.Doc] = []): pass # noqa: E704
902902
func = pdoc.Function('f', mod, f)
903903
self.assertEqual(func.params(), ['a', '*b', "c=[]"])
904904
self.assertEqual(func.params(annotate=True),
@@ -913,14 +913,14 @@ def link(dobj):
913913
"c:\N{NBSP}List[<a href=\"#pdoc.Doc\">Doc</a>]\N{NBSP}=\N{NBSP}[]"])
914914

915915
# typed, linked, GH-311
916-
def f(a: typing.Dict[str, pdoc.Doc]): pass
916+
def f(a: typing.Dict[str, pdoc.Doc]): pass # noqa: E704
917917

918918
func = pdoc.Function('f', mod, f)
919919
self.assertEqual(func.params(annotate=True, link=link),
920920
["a:\N{NBSP}Dict[str,\N{NBSP}<a href=\"#pdoc.Doc\">Doc</a>]"])
921921

922922
# shadowed name
923-
def f(pdoc: int): pass
923+
def f(pdoc: int): pass # noqa: E704
924924
func = pdoc.Function('f', mod, f)
925925
self.assertEqual(func.params(annotate=True, link=link), ['pdoc:\N{NBSP}int'])
926926

@@ -974,7 +974,7 @@ def test_test_Function_params_python38_specific(self):
974974
self.assertEqual(func.params(), ['a', '/'])
975975

976976
def test_Function_return_annotation(self):
977-
def f() -> typing.List[typing.Union[str, pdoc.Doc]]: return []
977+
def f() -> typing.List[typing.Union[str, pdoc.Doc]]: return [] # noqa: E704
978978
func = pdoc.Function('f', DUMMY_PDOC_MODULE, f)
979979
self.assertEqual(func.return_annotation(), 'List[str\N{NBSP}|\N{NBSP}pdoc.Doc]')
980980

‎pdoc/test/example_pkg/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ class Location(namedtuple('Location', 'lat lon')):
374374
"""Geo-location, GPS position."""
375375

376376

377-
def _func_spec(value: int) -> bool: ...
377+
def _func_spec(value: int) -> bool: ... # noqa: E704
378378

379379

380-
async def _coro_spec(value: int) -> bool: ...
380+
async def _coro_spec(value: int) -> bool: ... # noqa: E704
381381

382382

383383
class HasMockAttributes:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1/0
1+
1 / 0

‎setup.cfg

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
[flake8]
22
max-line-length = 100
3+
# F824 `nonlocal x` is unused: name is never assigned in scope
4+
# W503 Line break before a binary operator
5+
# W504 Line break after a binary operator -- https://www.flake8rules.com/rules/W504.html
6+
ignore = F824, W503, W504
37

48
[mypy]
59
warn_unused_ignores = True

0 commit comments

Comments
 (0)
Please sign in to comment.