Skip to content

Commit 94a52e0

Browse files
committed
lint with Ruff
1 parent 886e704 commit 94a52e0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sphinx/builders/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import time
88
from os import path
99
from typing import TYPE_CHECKING, Any
10-
from fnmatch import fnmatch, translate
10+
from fnmatch import fnmatch
1111

1212
from docutils import nodes
1313
from docutils.utils import DependencyList
@@ -423,12 +423,14 @@ def read(self) -> list[str]:
423423
if self.config.root_doc not in self.env.all_docs:
424424
root_doc_path = self.env.doc2path(self.config.root_doc)
425425
if ("**" in self.config.exclude_patterns or
426-
any([fnmatch(root_doc_path, pat) or root_doc_path.endswith(pat) for pat in self.config.exclude_patterns])):
426+
any(fnmatch(root_doc_path, pat) or root_doc_path.endswith(pat)
427+
for pat in self.config.exclude_patterns)):
427428
raise SphinxError('customized exclude_patterns is set ' +
428429
'and root file %s is in the exclude_patterns' %
429430
root_doc_path)
430431
elif ("**" not in self.config.include_patterns and
431-
not any([(fnmatch(root_doc_path, pat) or root_doc_path.endswith(pat)) for pat in self.config.include_patterns])):
432+
not any((fnmatch(root_doc_path, pat) or root_doc_path.endswith(pat))
433+
for pat in self.config.include_patterns)):
432434
raise SphinxError('customized include_patterns is set, ' +
433435
'but root file %s is not in the include_patterns' %
434436
root_doc_path)

0 commit comments

Comments
 (0)