mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
remove unnecessary list calls around 'sorted' (C413)
This commit is contained in:
parent
9e051dfb34
commit
55a0143df7
@ -355,7 +355,7 @@ def generate_autosummary_docs(sources: List[str], output_dir: str = None,
|
|||||||
suffix: str = '.rst', base_path: str = None,
|
suffix: str = '.rst', base_path: str = None,
|
||||||
imported_members: bool = False, app: Any = None,
|
imported_members: bool = False, app: Any = None,
|
||||||
overwrite: bool = True, encoding: str = 'utf-8') -> None:
|
overwrite: bool = True, encoding: str = 'utf-8') -> None:
|
||||||
showed_sources = list(sorted(sources))
|
showed_sources = sorted(sources)
|
||||||
if len(showed_sources) > 20:
|
if len(showed_sources) > 20:
|
||||||
showed_sources = showed_sources[:10] + ['...'] + showed_sources[-10:]
|
showed_sources = showed_sources[:10] + ['...'] + showed_sources[-10:]
|
||||||
logger.info(__('[autosummary] generating autosummary for: %s') %
|
logger.info(__('[autosummary] generating autosummary for: %s') %
|
||||||
|
@ -1113,11 +1113,11 @@ def test_domain_cpp_build_misuse_of_roles(app, status, warning):
|
|||||||
if targetType == 'templateParam':
|
if targetType == 'templateParam':
|
||||||
warn.append("WARNING: cpp:{} targets a {} (".format(r, txtTargetType))
|
warn.append("WARNING: cpp:{} targets a {} (".format(r, txtTargetType))
|
||||||
warn.append("WARNING: cpp:{} targets a {} (".format(r, txtTargetType))
|
warn.append("WARNING: cpp:{} targets a {} (".format(r, txtTargetType))
|
||||||
warn = list(sorted(warn))
|
warn = sorted(warn)
|
||||||
for w in ws:
|
for w in ws:
|
||||||
assert "targets a" in w
|
assert "targets a" in w
|
||||||
ws = [w[w.index("WARNING:"):] for w in ws]
|
ws = [w[w.index("WARNING:"):] for w in ws]
|
||||||
ws = list(sorted(ws))
|
ws = sorted(ws)
|
||||||
print("Expected warnings:")
|
print("Expected warnings:")
|
||||||
for w in warn:
|
for w in warn:
|
||||||
print(w)
|
print(w)
|
||||||
|
Loading…
Reference in New Issue
Block a user