Enable RUF019

This commit is contained in:
Adam Turner 2024-01-04 04:08:29 +00:00
parent 97a83acb17
commit 9a9599450c
3 changed files with 3 additions and 3 deletions

View File

@ -245,7 +245,7 @@ select = [
"RUF016", # Slice in indexed access to type `{value_type}` uses type `{index_type}` instead of an integer
# "RUF017", # Avoid quadratic list summation
"RUF018", # Avoid assignment expressions in `assert` statements
# "RUF019", # Unnecessary key check before dictionary access
"RUF019", # Unnecessary key check before dictionary access
"RUF020", # `{never_like} | T` is equivalent to `T`
# "RUF100", # Unused `noqa` directive
"RUF200", # Failed to parse pyproject.toml: {message}

View File

@ -81,7 +81,7 @@ class ReferencesResolver(SphinxPostTransform):
domain = None
try:
if 'refdomain' in node and node['refdomain']:
if node.get('refdomain', False):
# let the domain try to resolve the reference
try:
domain = self.env.domains[node['refdomain']]

View File

@ -288,7 +288,7 @@ class TexinfoTranslator(SphinxTranslator):
targets: list[Element] = [self.document]
targets.extend(self.document.findall(nodes.section))
for node in targets:
assert 'node_name' in node and node['node_name'] # NoQA: PT018
assert node.get('node_name', False)
entries = [s['node_name'] for s in find_subsections(node)]
node_menus[node['node_name']] = entries
# try to find a suitable "Top" node