fix: start each open finding with a capital

The statement of a finding follows a full stop on the Measurements page.
This commit is contained in:
Abdessamad Derraz committed 2026-10-27 13:07:33 +01:00
1 parent 5f3c836db9
commit 57436839a8
2 files changed
+9 -2

No files matched your search

+7 -1
View File
@@ -180,6 +180,12 @@ def _plain(value: object) -> str:
return "".join(_UNSAFE.get(char, char) for char in text)
def _sentence(value: object) -> str:
"""A finding's statement as a sentence of the page: capital first."""
text = _plain(value)
return text[:1].upper() + text[1:]
def _code(value: object) -> str:
"""A value as code that cannot close its element or open an expression."""
return f"<code>{_plain(value)}</code>"
@@ -227,7 +233,7 @@ def campaign_section(summary: dict | None) -> list[str]:
lines += [
f"- **{_plain(item['emulator'])}**, {_code(item['file'])}, {_code(item['field'])} "
f"({_plain(item['status'])}): the profile says {_value(item['profile_says'])}, the run "
f"shows {_value(item['run_shows'])}. {_plain(item['statement'])}. Records: {records}.",
f"shows {_value(item['run_shows'])}. {_sentence(item['statement'])}. Records: {records}.",
"",
]
return lines
+2 -1
View File
@@ -859,7 +859,7 @@ class SitePage(unittest.TestCase):
"failed": [{"emulator": "fake", "check": "fake/x/y/bench", "reason": "timeout"}]},
"passes": 1, "applied": 2,
"open": [{"emulator": "fake", "file": "bios.bin", "field": "required", "status": "open",
"profile_says": True, "run_shows": False, "statement": "boots without it",
"profile_says": True, "run_shows": False, "statement": "the core boots without it",
"evidence": ["2026-10-27-aaaaaaaaaaaa"], "links": ["https://x/l#L1"]}],
}
page = "\n".join(sitemeasurements.campaign_section(summary))
@@ -867,6 +867,7 @@ class SitePage(unittest.TestCase):
self.assertIn("| standalone | 3 |", page)
self.assertIn("the profile says <code>true</code>, the run shows <code>false</code>", page)
self.assertIn("[2026-10-27-aaaaaaaaaaaa](https://x/l#L1)", page)
self.assertIn("<code>false</code>. The core boots without it. Records:", page)
self.assertEqual(sitemeasurements.campaign_section({"last_run": None}), [])
def test_observed_values_cannot_leave_their_place(self) -> None: