Skip to content

Commit 373d180

Browse files
committed
chore: Remove trailing whitespace in cppllvm_build.py files and update test cases to utilize constants for helper banners, improving code consistency and readability.
1 parent 28a107f commit 373d180

4 files changed

Lines changed: 14 additions & 15 deletions

File tree

cppllvm_build.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# Canonical shared build helper for cppllvm packages.
44
# Package-local copies are vendored so each package can build in isolation.
5-
65
import os
76
import re
87
import shutil

packages/cformat/cppllvm_build.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# Vendored copy of /cppllvm_build.py.
44
# This file stays package-local so `packages/cformat` can build in isolation.
5-
65
import os
76
import re
87
import shutil

packages/ctidy/cppllvm_build.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# Vendored copy of /cppllvm_build.py.
44
# This file stays package-local so `packages/ctidy` can build in isolation.
5-
65
import os
76
import re
87
import shutil

tests/test_cppllvm_build.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717

1818

1919
ROOT = Path(__file__).resolve().parents[1]
20+
ROOT_HELPER_BANNER = (
21+
"Canonical shared build helper for cppllvm packages.\n"
22+
"# Package-local copies are vendored so each package can build in isolation."
23+
)
24+
CTIDY_HELPER_BANNER = (
25+
"Vendored copy of /cppllvm_build.py.\n"
26+
"# This file stays package-local so `packages/ctidy` can build in isolation."
27+
)
28+
CFORMAT_HELPER_BANNER = (
29+
"Vendored copy of /cppllvm_build.py.\n"
30+
"# This file stays package-local so `packages/cformat` can build in isolation."
31+
)
2032
CTIDY_CONFIG = PackageBuildConfig(
2133
package_dir=ROOT / "packages/ctidy",
2234
package_name="ctidy",
@@ -36,21 +48,11 @@ def test_vendored_build_helpers_match_root_copy(self) -> None:
3648
root_helper = (ROOT / "cppllvm_build.py").read_text(encoding="utf-8")
3749
self.assertEqual(
3850
(ROOT / "packages/ctidy/cppllvm_build.py").read_text(encoding="utf-8"),
39-
root_helper.replace(
40-
"Canonical shared build helper for cppllvm packages.\n"
41-
"# Package-local copies are vendored so each package can build in isolation.",
42-
"Vendored copy of /cppllvm_build.py.\n"
43-
"# This file stays package-local so `packages/ctidy` can build in isolation.",
44-
),
51+
root_helper.replace(ROOT_HELPER_BANNER, CTIDY_HELPER_BANNER),
4552
)
4653
self.assertEqual(
4754
(ROOT / "packages/cformat/cppllvm_build.py").read_text(encoding="utf-8"),
48-
root_helper.replace(
49-
"Canonical shared build helper for cppllvm packages.\n"
50-
"# Package-local copies are vendored so each package can build in isolation.",
51-
"Vendored copy of /cppllvm_build.py.\n"
52-
"# This file stays package-local so `packages/cformat` can build in isolation.",
53-
),
55+
root_helper.replace(ROOT_HELPER_BANNER, CFORMAT_HELPER_BANNER),
5456
)
5557

5658
@patch("cppllvm_build.machine", return_value="x86_64")

0 commit comments

Comments
 (0)