Bump to Ruff 0.9.3

This commit is contained in:
Adam Turner 2025-01-25 00:48:18 +00:00
parent a1c77f1725
commit 0bc8b4115d
5 changed files with 8 additions and 13 deletions

View File

@ -81,7 +81,7 @@ docs = [
"sphinxcontrib-websupport",
]
lint = [
"ruff==0.9.2",
"ruff==0.9.3",
"mypy==1.14.1",
"sphinx-lint>=0.9",
"types-colorama==0.4.15.20240311",

View File

@ -418,8 +418,6 @@ class LaTeXBuilder(Builder):
nodes.Text(')'),
))
break
else:
pass
pendingnode.replace_self(newnodes)
return largetree

View File

@ -186,8 +186,6 @@ class TexinfoBuilder(Builder):
nodes.Text(')'),
))
break
else:
pass
pendingnode.replace_self(newnodes)
return largetree

View File

@ -253,7 +253,7 @@ class CoverageBuilder(Builder):
for filename, undoc in self.c_undoc.items():
write_header(op, filename)
for typ, name in sorted(undoc):
op.write(' * %-50s [%9s]\n' % (name, typ))
op.write(f' * {name:<50} [{typ:>9}]\n')
if self.config.coverage_show_missing_items:
if self.app.quiet:
logger.warning(
@ -415,8 +415,7 @@ class CoverageBuilder(Builder):
else:
table.append(['TOTAL', '100', '0'])
for line in _write_table(table):
op.write(f'{line}\n')
op.writelines(f'{line}\n' for line in _write_table(table))
def write_py_coverage(self) -> None:
output_file = self.outdir / 'python.txt'
@ -445,7 +444,7 @@ class CoverageBuilder(Builder):
write_header(op, name)
if undoc['funcs']:
op.write('Functions:\n')
op.writelines(' * %s\n' % x for x in undoc['funcs'])
op.writelines(f' * {x}\n' for x in undoc['funcs'])
if self.config.coverage_show_missing_items:
if self.app.quiet:
for func in undoc['funcs']:
@ -467,7 +466,7 @@ class CoverageBuilder(Builder):
op.write('Classes:\n')
for class_name, methods in sorted(undoc['classes'].items()):
if not methods:
op.write(' * %s\n' % class_name)
op.write(f' * {class_name}\n')
if self.config.coverage_show_missing_items:
if self.app.quiet:
logger.warning(
@ -483,8 +482,8 @@ class CoverageBuilder(Builder):
+ name
)
else:
op.write(' * %s -- missing methods:\n\n' % class_name)
op.writelines(' - %s\n' % x for x in methods)
op.write(f' * {class_name} -- missing methods:\n\n')
op.writelines(f' - {x}\n' for x in methods)
if self.config.coverage_show_missing_items:
if self.app.quiet:
for meth in methods:

View File

@ -83,7 +83,7 @@ _INVALID_BUILTIN_CLASSES: Final[Mapping[object, str]] = {
pathlib.WindowsPath: 'pathlib.WindowsPath',
# types in 'pickle' with <type>.__module__ == 'pickle':
pickle.Pickler: 'pickle.Pickler',
pickle.Unpickler: 'pickle.Unpickler',
pickle.Unpickler: 'pickle.Unpickler', # NoQA: S301
# types in 'struct' with <type>.__module__ == '_struct':
struct.Struct: 'struct.Struct',
# types in 'types' with <type>.__module__ == 'builtins':