')
for item in self.items:
rv += item.generate(doc)
diff --git a/lobster/tools/codebeamer/codebeamer.py b/lobster/tools/codebeamer/codebeamer.py
index 53f3b73b..85dce376 100755
--- a/lobster/tools/codebeamer/codebeamer.py
+++ b/lobster/tools/codebeamer/codebeamer.py
@@ -200,9 +200,9 @@ def get_many_items(cb_config: Config, item_ids: Iterable[int]):
f"({','.join(str(item_id) for item_id in item_ids)})")
while True:
- base_url = "%s/items/query?page=%u&pageSize=%u&queryString=%s"\
- % (cb_config.base, page_id,
- cb_config.page_size, query_string)
+ base_url = (f"{cb_config.base}/items/query?page={page_id}"
+ f"&pageSize={cb_config.page_size}"
+ f"&queryString={query_string}")
data = query_cb_single(cb_config, base_url)
rv += data["items"]
if len(rv) == data["total"]:
@@ -224,19 +224,13 @@ def get_query(cb_config: Config, query: Union[int, str]):
total_items = None
while total_items is None or len(rv) < total_items:
- print("Fetching page %u of query..." % page_id)
+ print(f"Fetching page {page_id} of query...")
if isinstance(query, int):
- url = ("%s/reports/%u/items?page=%u&pageSize=%u" %
- (cb_config.base,
- query,
- page_id,
- cb_config.page_size))
+ url = (f"{cb_config.base}/reports/{query}/items"
+ f"?page={page_id}&pageSize={cb_config.page_size}")
elif isinstance(query, str):
- url = ("%s/items/query?page=%u&pageSize=%u&queryString=%s" %
- (cb_config.base,
- page_id,
- cb_config.page_size,
- query))
+ url = (f"{cb_config.base}/items/query?page={page_id}"
+ f"&pageSize={cb_config.page_size}&queryString={query}")
data = query_cb_single(cb_config, url)
if len(data) != 4:
raise MismatchException(
diff --git a/lobster/tools/core/html_report/html_report.py b/lobster/tools/core/html_report/html_report.py
index 6a74e3fe..623486cf 100755
--- a/lobster/tools/core/html_report/html_report.py
+++ b/lobster/tools/core/html_report/html_report.py
@@ -151,18 +151,18 @@ def create_item_coverage(doc, report):
doc.add_line(
f'
'
)
- doc.add_line('| %s | ' %
- (name_hash(level.name),
- html.escape(level.name)))
+ doc.add_line(
+ f''
+ f'{html.escape(level.name)} | '
+ )
doc.add_line(f"{data.coverage:.1f}% | ")
doc.add_line("")
- doc.add_line(' | ")
- doc.add_line('%u | ' % data.ok)
- doc.add_line('%u | ' % data.items)
+ doc.add_line(f'{data.ok} | ')
+ doc.add_line(f'{data.items} | ')
doc.add_line("
")
doc.add_line("")
@@ -205,12 +205,13 @@ def write_item_box_begin(doc, item, report):
doc.add_line(f'
')
- doc.add_line('
%s %s
' %
- ('
'
- if item.tracing_status in (Tracing_Status.OK,
- Tracing_Status.JUSTIFIED)
- else '
',
- xref_item(item, link=False)))
+ svg_icon = (
+ '
'
+ if item.tracing_status in (Tracing_Status.OK, Tracing_Status.JUSTIFIED)
+ else '
'
+ )
+ item_div_content = f'{svg_icon} {xref_item(item, link=False)}'
+ doc.add_line(f'
{item_div_content}
')
doc.add_line('
Source: ')
doc.add_line('')
@@ -533,9 +534,10 @@ def write_html(report, dot, high_contrast, render_md) -> str:
Github_Reference)):
new_file_heading = item.location.filename
elif isinstance(item.location, Codebeamer_Reference):
- new_file_heading = "Codebeamer %s, tracker %u" % \
- (item.location.cb_root,
- item.location.tracker)
+ new_file_heading = (
+ f"Codebeamer {item.location.cb_root},"
+ f" tracker {item.location.tracker}"
+ )
else: # pragma: no cover
assert False
if new_file_heading != file_heading:
diff --git a/lobster/tools/cpptest/constants.py b/lobster/tools/cpptest/constants.py
index 60134a1b..119cee2e 100644
--- a/lobster/tools/cpptest/constants.py
+++ b/lobster/tools/cpptest/constants.py
@@ -6,9 +6,10 @@ def __init__(self, codebeamer_url = ''):
self.codebeamer_link = codebeamer_url + "/issue/"
self.requirement = re.compile(r'@requirement[\s\S]*?(?=@|\Z)')
- self.requirement_tag_http = ((r"([@\\]requirement(\s+"
- r"(CB-#\d+\s+)*({}\d+\s*,?\s*/*\*?)+)+)")
- .format(self.codebeamer_link))
+ self.requirement_tag_http = (
+ rf"([@\\]requirement(\s+(CB-#\d+\s+)*"
+ rf"({self.codebeamer_link}\d+\s*,?\s*/*\*?)+)+)"
+ )
self.requirement_tag_http_named = rf"({self.codebeamer_link}(?P\d+))"
NON_EXISTING_INFO = "---"
diff --git a/lobster/tools/python/python.py b/lobster/tools/python/python.py
index 566afc08..d2a7a7d9 100755
--- a/lobster/tools/python/python.py
+++ b/lobster/tools/python/python.py
@@ -155,17 +155,12 @@ def lobster_tag(self):
def warn_ignored(self, reason):
for tag in self.tags:
- print("%s: warning: ignored tag %s because "
- "%s already has annotations" %
- (self.location.to_string(),
- tag,
- reason))
+ print(f"{self.location.to_string()}: warning: ignored tag {tag}"
+ f" because {reason} already has annotations")
for just in self.just:
- print("%s: warning: ignored justification '%s' because "
- "%s already has annotations" %
- (self.location.to_string(),
- just,
- reason))
+ print(f"{self.location.to_string()}: warning: "
+ f"ignored justification '{just}' "
+ f"because {reason} already has annotations")
class Python_Module(Python_Traceable_Node):
diff --git a/pylint3.cfg b/pylint3.cfg
index e2c37e70..7ea9fea0 100644
--- a/pylint3.cfg
+++ b/pylint3.cfg
@@ -10,8 +10,7 @@ disable=
too-many-arguments,
too-many-locals,
too-many-statements,
- too-many-nested-blocks,
- consider-using-f-string
+ too-many-nested-blocks
[REPORTS]
output-format=text
diff --git a/util/bump_version_post_release.py b/util/bump_version_post_release.py
index 27f2b29f..2c485aa5 100644
--- a/util/bump_version_post_release.py
+++ b/util/bump_version_post_release.py
@@ -35,9 +35,7 @@
with open(VERSION_FILE, encoding="UTF-8") as fd:
for raw_line in fd:
if raw_line.startswith("VERSION_TUPLE"):
- raw_line = 'VERSION_TUPLE = (%u, %u, %u)\n' % (major,
- minor,
- release)
+ raw_line = f'VERSION_TUPLE = ({major}, {minor}, {release})\n'
elif raw_line.startswith("VERSION_SUFFIX"):
raw_line = 'VERSION_SUFFIX = "dev"\n'
@@ -45,7 +43,7 @@
with open(VERSION_FILE, "w", encoding="UTF-8") as fd:
fd.write(tmp)
-LOBSTER_VERSION = "%u.%u.%u-dev" % (major, minor, release)
+LOBSTER_VERSION = f"{major}.{minor}.{release}-dev"
# Update changelog and docs, adding a new entry