Skip to content

Commit 7cf9888

Browse files
committed
MNT: Fix flake8 errors
1 parent 8a7a0f2 commit 7cf9888

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
wget -O/tmp/pandoc.deb https://github.com/jgm/pandoc/releases/download/2.10/pandoc-2.10-1-amd64.deb && sudo dpkg -i /tmp/pandoc.deb
3737
3838
- run: find -name '*.md' | xargs .github/lint-markdown.sh
39-
- run: flake8
39+
- run: flake8 pdoc setup.py
4040
- run: mypy -p pdoc
4141
- run: time coverage run -m unittest -v pdoc.test
4242
- run: bash <(curl -s https://codecov.io/bash)

pdoc/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,13 @@ def main(_args=None):
524524
httpd.server_close()
525525
sys.exit(0)
526526

527-
docfilter = None
528527
if args.filter and args.filter.strip():
529528
def docfilter(obj, _filters=args.filter.strip().split(',')):
530529
return any(f in obj.refname or
531530
isinstance(obj, pdoc.Class) and f in obj.doc
532531
for f in _filters)
532+
else:
533+
docfilter = None
533534

534535
modules = [pdoc.Module(module, docfilter=docfilter,
535536
skip_errors=args.skip_errors)

pdoc/test/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ def test_html_ref_links(self):
250250
)
251251

252252
def test_docformat(self):
253-
with self.assertWarns(UserWarning) as cm,\
253+
with self.assertWarns(UserWarning) as cm, \
254254
run_html(EXAMPLE_MODULE, config='docformat="restructuredtext"'):
255255
self._basic_html_assertions()
256256
self.assertIn('numpy', cm.warning.args[0])
257257

258258
def test_html_no_source(self):
259-
with self.assertWarns(DeprecationWarning),\
259+
with self.assertWarns(DeprecationWarning), \
260260
run_html(EXAMPLE_MODULE, html_no_source=None):
261261
self._basic_html_assertions()
262262
self._check_files(exclude_patterns=['class="source"', 'Hidden'])
@@ -301,7 +301,7 @@ def test_external_links(self):
301301
self._basic_html_assertions()
302302
self._check_files(exclude_patterns=['<a href="/sys.version.ext"'])
303303

304-
with self.assertWarns(DeprecationWarning),\
304+
with self.assertWarns(DeprecationWarning), \
305305
run_html(EXAMPLE_MODULE, external_links=None):
306306
self._basic_html_assertions()
307307
self._check_files(['<a title="sys.version" href="/sys.version.ext"'])
@@ -319,7 +319,7 @@ def test_template_dir(self):
319319
pdoc.tpl_lookup._collection.clear()
320320

321321
def test_link_prefix(self):
322-
with self.assertWarns(DeprecationWarning),\
322+
with self.assertWarns(DeprecationWarning), \
323323
run_html(EXAMPLE_MODULE, link_prefix='/foobar/'):
324324
self._basic_html_assertions()
325325
self._check_files(['/foobar/' + EXAMPLE_MODULE])
@@ -445,8 +445,8 @@ def test_relative_dir_path(self):
445445
self._check_files(())
446446

447447
def test_skip_errors(self):
448-
with chdir(os.path.join(TESTS_BASEDIR, EXAMPLE_MODULE, '_skip_errors')),\
449-
redirect_streams(),\
448+
with chdir(os.path.join(TESTS_BASEDIR, EXAMPLE_MODULE, '_skip_errors')), \
449+
redirect_streams(), \
450450
self.assertWarns(pdoc.Module.ImportWarning) as cm:
451451
run('.', skip_errors=None)
452452
self.assertIn('ZeroDivision', cm.warning.args[0])

0 commit comments

Comments
 (0)