@@ -107,17 +107,14 @@ def create_policy_diagram(doc, report, dot):
107107 style = 'shape=hexagon'
108108 style += f', href="#sec-{ name_hash (level .name )} "'
109109
110- graph += ' n_%s [label="%s", %s];\n ' % \
111- (name_hash (level .name ),
112- level .name ,
113- style )
110+ graph += f' n_{ name_hash (level .name )} [label="{ level .name } ", { style } ];\n '
114111
115112 for level in report .config .values ():
116113 source = name_hash (level .name )
117114 for target in map (name_hash , level .traces ):
118115 # Not a mistake; we want to show the tracing down, whereas
119116 # in the config file we indicate how we trace up.
120- graph += ' n_%s -> n_%s ;\n ' % ( target , source )
117+ graph += f ' n_{ target } -> n_{ source } ;\n '
121118 graph += "}\n "
122119
123120 with tempfile .TemporaryDirectory () as tmp_dir :
@@ -157,11 +154,11 @@ def create_item_coverage(doc, report):
157154 doc .add_line ('<td><a href="#sec-%s">%s</a></td>' %
158155 (name_hash (level .name ),
159156 html .escape (level .name )))
160- doc .add_line ("<td>%.1f%% </td>" % data . coverage )
157+ doc .add_line (f "<td>{ data . coverage :.1f } % </td>" )
161158 doc .add_line ("<td>" )
162159 doc .add_line ('<progress value="%u" max="%u">' %
163160 (data .ok , data .items ))
164- doc .add_line ("%.2f%%" % data . coverage )
161+ doc .add_line (f" { data . coverage :.2f } %" )
165162 doc .add_line ('</progress>' )
166163 doc .add_line ("</td>" )
167164 doc .add_line ('<td align="right">%u</td>' % data .ok )
@@ -232,30 +229,30 @@ def write_item_tracing(doc, report, item):
232229 doc .add_line ("<div>Traces to:" )
233230 doc .add_line ("<ul>" )
234231 for ref in item .ref_down :
235- doc .add_line ("<li>%s</li>" % xref_item (report .items [ref .key ()]))
232+ doc .add_line (f "<li>{ xref_item (report .items [ref .key ()])} </li>" )
236233 doc .add_line ("</ul>" )
237234 doc .add_line ("</div>" )
238235 if item .ref_up :
239236 doc .add_line ("<div>Derived from:" )
240237 doc .add_line ("<ul>" )
241238 for ref in item .ref_up :
242- doc .add_line ("<li>%s</li>" % xref_item (report .items [ref .key ()]))
239+ doc .add_line (f "<li>{ xref_item (report .items [ref .key ()])} </li>" )
243240 doc .add_line ("</ul>" )
244241 doc .add_line ("</div>" )
245242
246243 if item .tracing_status == Tracing_Status .JUSTIFIED :
247244 doc .add_line ("<div>Justifications:" )
248245 doc .add_line ("<ul>" )
249246 for msg in item .just_global + item .just_up + item .just_down :
250- doc .add_line ("<li>%s</li>" % html .escape (msg ))
247+ doc .add_line (f "<li>{ html .escape (msg )} </li>" )
251248 doc .add_line ("</ul>" )
252249 doc .add_line ("</div>" )
253250
254251 if item .messages :
255252 doc .add_line ("<div>Issues:" )
256253 doc .add_line ("<ul>" )
257254 for msg in item .messages :
258- doc .add_line ("<li>%s</li>" % html .escape (msg ))
255+ doc .add_line (f "<li>{ html .escape (msg )} </li>" )
259256 doc .add_line ("</ul>" )
260257 doc .add_line ("</div>" )
261258
@@ -422,9 +419,9 @@ def write_html(report, dot, high_contrast, render_md) -> str:
422419 doc .add_line (f'<div id="custom-data-banner">{ content } </div>' )
423420 menu = doc .navbar .add_dropdown ("LOBSTER" , "right" )
424421 menu .add_link ("Documentation" ,
425- "%s /blob/main/README.md" % LOBSTER_GH )
422+ f" { LOBSTER_GH } /blob/main/README.md" )
426423 menu .add_link ("License" ,
427- "%s /blob/main/LICENSE.md" % LOBSTER_GH )
424+ f" { LOBSTER_GH } /blob/main/LICENSE.md" )
428425 menu .add_link ("Source" , LOBSTER_GH )
429426
430427 ### Summary (Coverage & Policy)
@@ -548,7 +545,7 @@ def write_html(report, dot, high_contrast, render_md) -> str:
548545 write_item_box_begin (doc , item , report )
549546 if isinstance (item , Requirement ) and item .status :
550547 doc .add_line ('<div class="attribute">' )
551- doc .add_line ("Status: %s" % html .escape (item .status ))
548+ doc .add_line (f "Status: { html .escape (item .status )} " )
552549 doc .add_line ('</div>' )
553550 if (isinstance (item , (Requirement , Activity )) and item .text ):
554551 if render_md :
0 commit comments