Skip to content

Commit 14818ff

Browse files
committed
Bump Ruff to 0.11.3
1 parent 021d6a8 commit 14818ff

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ docs = [
9292
"sphinxcontrib-websupport",
9393
]
9494
lint = [
95-
"ruff==0.11.2",
95+
"ruff==0.11.3",
9696
"mypy==1.15.0",
9797
"sphinx-lint>=0.9",
9898
"types-colorama==0.4.15.20240311",
@@ -135,7 +135,7 @@ docs = [
135135
"sphinxcontrib-websupport",
136136
]
137137
lint = [
138-
"ruff==0.11.2",
138+
"ruff==0.11.3",
139139
"sphinx-lint>=0.9",
140140
]
141141
package = [

sphinx/ext/autosummary/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def generate_autosummary_docs(
583583

584584
showed_sources = sorted(sources)
585585
if len(showed_sources) > 20:
586-
showed_sources = showed_sources[:10] + ['...'] + showed_sources[-10:]
586+
showed_sources = [*showed_sources[:10], '...', *showed_sources[-10:]]
587587
logger.info(
588588
__('[autosummary] generating autosummary for: %s'), ', '.join(showed_sources)
589589
)

sphinx/ext/napoleon/docstring.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def _consume_returns_section(
535535

536536
if colon:
537537
if after:
538-
_desc = [after] + lines[1:]
538+
_desc = [after, *lines[1:]]
539539
else:
540540
_desc = lines[1:]
541541

@@ -684,7 +684,7 @@ def _format_field(self, _name: str, _type: str, _desc: list[str]) -> list[str]:
684684
if has_desc:
685685
_desc = self._fix_field_desc(_desc)
686686
if _desc[0]:
687-
return [field + _desc[0]] + _desc[1:]
687+
return [field + _desc[0], *_desc[1:]]
688688
else:
689689
return [field, *_desc]
690690
else:

sphinx/pycode/parser.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def get_qualname_for(self, name: str) -> list[str] | None:
257257
if self.current_function:
258258
if self.current_classes and self.context[-1] == '__init__':
259259
# store variable comments inside __init__ method of classes
260-
return self.context[:-1] + [name]
260+
return [*self.context[:-1], name]
261261
else:
262262
return None
263263
else:
@@ -387,9 +387,10 @@ def visit_Assign(self, node: ast.Assign) -> None:
387387
self.add_variable_annotation(varname, node.type_comment) # type: ignore[arg-type]
388388

389389
# check comments after assignment
390-
parser = AfterCommentParser(
391-
[current_line[node.col_offset :]] + self.buffers[node.lineno :]
392-
)
390+
parser = AfterCommentParser([
391+
current_line[node.col_offset :],
392+
*self.buffers[node.lineno :],
393+
])
393394
parser.parse()
394395
if parser.comment and comment_re.match(parser.comment):
395396
for varname in varnames:

sphinx/transforms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class SortIds(SphinxTransform):
217217
def apply(self, **kwargs: Any) -> None:
218218
for node in self.document.findall(nodes.section):
219219
if len(node['ids']) > 1 and node['ids'][0].startswith('id'):
220-
node['ids'] = node['ids'][1:] + [node['ids'][0]]
220+
node['ids'] = [*node['ids'][1:], node['ids'][0]]
221221

222222

223223
TRANSLATABLE_NODES = {

tests/test_builders/test_build_latex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_build_latex_doc(app, engine, docclass, python_maximum_signature_line_le
143143
}
144144
intersphinx_setup(app)
145145
app.config.latex_engine = engine
146-
app.config.latex_documents = [app.config.latex_documents[0][:4] + (docclass,)]
146+
app.config.latex_documents = [(*app.config.latex_documents[0][:4], docclass)]
147147
if engine == 'xelatex':
148148
app.config.latex_table_style = ['booktabs']
149149
elif engine == 'lualatex':

0 commit comments

Comments
 (0)