[pylint] Fixes all `use-maxplit-args, consider-using-enumerate` (#12172)

* [pylint 'use-maxsplit-arg'] Do not split more than necessary when using the first element

* [pylint 'consider-using-enumerate'] Use zip when iterating on two iterators

* [pylint] 'cell-var-from-loop' and 'disallowed-name' permanent disable

* [pylint] Disable 'possibly-used-before-assignment' following 3.2.0 release
This commit is contained in:
Pierre Sassoulas
2024-05-27 21:18:03 +02:00
committed by GitHub
parent 24abe4eb03
commit 88fae23bdd
4 changed files with 18 additions and 16 deletions

View File

@@ -1821,7 +1821,10 @@ def _show_fixtures_per_test(config: Config, session: "Session") -> None:
fixture_doc = inspect.getdoc(fixture_def.func)
if fixture_doc:
write_docstring(
tw, fixture_doc.split("\n\n")[0] if verbose <= 0 else fixture_doc
tw,
fixture_doc.split("\n\n", maxsplit=1)[0]
if verbose <= 0
else fixture_doc,
)
else:
tw.line(" no docstring available", red=True)
@@ -1903,7 +1906,9 @@ def _showfixtures_main(config: Config, session: "Session") -> None:
tw.write("\n")
doc = inspect.getdoc(fixturedef.func)
if doc:
write_docstring(tw, doc.split("\n\n")[0] if verbose <= 0 else doc)
write_docstring(
tw, doc.split("\n\n", maxsplit=1)[0] if verbose <= 0 else doc
)
else:
tw.line(" no docstring available", red=True)
tw.line()