Reduce the formatter's target line length to 88 (#12757)

This commit is contained in:
Adam Turner
2024-08-11 00:19:50 +01:00
committed by GitHub
parent d7a22c2d0a
commit 18fbced7e0
28 changed files with 250 additions and 65 deletions

View File

@@ -62,7 +62,15 @@ class IngredientIndex(Index):
for ingredient, recipe_names in ingredient_recipes.items():
for recipe_name in recipe_names:
dispname, typ, docname, anchor = recipes[recipe_name]
content[ingredient].append((dispname, 0, docname, anchor, docname, '', typ))
content[ingredient].append((
dispname,
0,
docname,
anchor,
docname,
'',
typ,
))
# convert the dict to the sorted list of tuples expected
content = sorted(content.items())
@@ -153,7 +161,14 @@ class RecipeDomain(Domain):
self.data['recipe_ingredients'][name] = ingredients
# name, dispname, type, docname, anchor, priority
self.data['recipes'].append((name, signature, 'Recipe', self.env.docname, anchor, 0))
self.data['recipes'].append((
name,
signature,
'Recipe',
self.env.docname,
anchor,
0,
))
def setup(app: Sphinx) -> ExtensionMetadata:

View File

@@ -57,7 +57,9 @@ def purge_todos(app, env, docname):
if not hasattr(env, 'todo_all_todos'):
return
env.todo_all_todos = [todo for todo in env.todo_all_todos if todo['docname'] != docname]
env.todo_all_todos = [
todo for todo in env.todo_all_todos if todo['docname'] != docname
]
def merge_todos(app, env, docnames, other):
@@ -98,7 +100,9 @@ def process_todo_nodes(app, doctree, fromdocname):
newnode = nodes.reference('', '')
innernode = nodes.emphasis(_('here'), _('here'))
newnode['refdocname'] = todo_info['docname']
newnode['refuri'] = app.builder.get_relative_uri(fromdocname, todo_info['docname'])
newnode['refuri'] = app.builder.get_relative_uri(
fromdocname, todo_info['docname']
)
newnode['refuri'] += '#' + todo_info['target']['refid']
newnode.append(innernode)
para += newnode