remove unnecessary list calls around 'sorted' (C413)

This commit is contained in:
Daniel Eades 2022-01-09 16:52:03 +00:00 committed by Adam Turner
parent 9e051dfb34
commit 55a0143df7
2 changed files with 3 additions and 3 deletions

View File

@ -355,7 +355,7 @@ def generate_autosummary_docs(sources: List[str], output_dir: str = None,
suffix: str = '.rst', base_path: str = None,
imported_members: bool = False, app: Any = None,
overwrite: bool = True, encoding: str = 'utf-8') -> None:
showed_sources = list(sorted(sources))
showed_sources = sorted(sources)
if len(showed_sources) > 20:
showed_sources = showed_sources[:10] + ['...'] + showed_sources[-10:]
logger.info(__('[autosummary] generating autosummary for: %s') %

View File

@ -1113,11 +1113,11 @@ def test_domain_cpp_build_misuse_of_roles(app, status, warning):
if targetType == 'templateParam':
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:
assert "targets a" in w
ws = [w[w.index("WARNING:"):] for w in ws]
ws = list(sorted(ws))
ws = sorted(ws)
print("Expected warnings:")
for w in warn:
print(w)