mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 11:46:35 +00:00
style: settle the formatter and linter rewrites of this branch
Every commit here went in with `--no-verify`, so the pre-commit `make test` never ran and neither the formatter nor the linter saw the change sets. The quality gate collects that debt now. `test_aliases.py` built a lookup table by handing a generator to `dict()`, which ruff C402 rejects and offers no autofix for; a dict comprehension does the same work. `selections.py` and `test_translate.py` each wrapped a call across three lines that fits on one, which is the formatter's own rewrite from the run that then aborted on the C402 above. All three edits preserve behaviour: the comprehension is equivalent to the generator it replaces, and the rest is whitespace. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f4016340cf
commit
4c66220c50
3 files changed
+5
-11
No files matched your search
@@ -117,9 +117,7 @@ def collapse_failures(tokens: Iterable[str], hard: Iterable[str]) -> list[str]:
|
||||
sorted, deduplicated role ids and selection tokens.
|
||||
"""
|
||||
roles = set(collapse_to_roles(hard))
|
||||
pinned = {
|
||||
token for token in tokens if selection.parse(token).app not in roles
|
||||
}
|
||||
pinned = {token for token in tokens if selection.parse(token).app not in roles}
|
||||
return sorted(roles | pinned)
|
||||
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ class TestParse(unittest.TestCase):
|
||||
|
||||
def test_the_trailing_comment_is_captured(self) -> None:
|
||||
self.assertEqual(
|
||||
dict((n, c) for n, _, c in self._parse(ALIASES))["i8far"],
|
||||
{n: c for n, _, c in self._parse(ALIASES)}["i8far"],
|
||||
"does a far thing",
|
||||
)
|
||||
|
||||
def test_a_make_wrapper_carries_no_comment(self) -> None:
|
||||
self.assertIsNone(dict((n, c) for n, _, c in self._parse(ALIASES))["i8bui"])
|
||||
self.assertIsNone({n: c for n, _, c in self._parse(ALIASES)}["i8bui"])
|
||||
|
||||
def test_an_unparseable_alias_line_raises(self) -> None:
|
||||
"""Skipping it would drop the alias from the page with no trace."""
|
||||
|
||||
@@ -393,9 +393,7 @@ class TestOverSharedTranslation(unittest.TestCase):
|
||||
return sorted(str(message.id) for message in over_shared(catalog))
|
||||
|
||||
def test_every_sharer_beyond_the_limit_is_returned(self) -> None:
|
||||
catalog = self._catalog(
|
||||
[self.LONG_A, self.LONG_B, self.LONG_C], self.SHARED
|
||||
)
|
||||
catalog = self._catalog([self.LONG_A, self.LONG_B, self.LONG_C], self.SHARED)
|
||||
|
||||
self.assertEqual(
|
||||
self._ids(catalog), sorted([self.LONG_A, self.LONG_B, self.LONG_C])
|
||||
@@ -407,9 +405,7 @@ class TestOverSharedTranslation(unittest.TestCase):
|
||||
self.assertEqual(over_shared(catalog), [])
|
||||
|
||||
def test_short_sources_may_share_one(self) -> None:
|
||||
catalog = self._catalog(
|
||||
[self.SHORT_A, self.SHORT_B, self.SHORT_C], "Datei"
|
||||
)
|
||||
catalog = self._catalog([self.SHORT_A, self.SHORT_B, self.SHORT_C], "Datei")
|
||||
|
||||
self.assertEqual(over_shared(catalog), [])
|
||||
|
||||
|
||||
Reference in new issue
Block a user