Skip to content

Commit 53f16ab

Browse files
committed
chore(lint): enforce explicit string concat policy
1 parent b4e3018 commit 53f16ab

4 files changed

Lines changed: 26 additions & 13 deletions

File tree

dashboard_action/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ def _validate_secret(value: str, label: str, *, allow_weak: bool) -> None:
215215
if len(value) < MIN_SECRET_LENGTH and not allow_weak:
216216
raise ActionError(
217217
f"{label} is below the Reponomics dashboard secret entropy policy. "
218-
"Use a generated random secret, or set allow-weak-dashboard-secret "
219-
"to true if you explicitly accept the disclosure and brute-force risk."
218+
+ "Use a generated random secret, or set allow-weak-dashboard-secret "
219+
+ "to true if you explicitly accept the disclosure and brute-force risk."
220220
)
221221

222222

dashboard_action/runtime/scripts/collect.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,8 @@ def resolve_repositories(
565565
if missing_include_only:
566566
print(
567567
"Warning: some configured include_only repos were not eligible "
568-
"for tracking (missing access, archived, forked, disabled, or "
569-
"no push access): "
568+
+ "for tracking (missing access, archived, forked, disabled, or "
569+
+ "no push access): "
570570
+ ", ".join(missing_include_only)
571571
)
572572
resolved = [repo["full_name"] for repo in include_only_repos[:max_repos]]
@@ -588,8 +588,8 @@ def resolve_repositories(
588588
if missing_include:
589589
print(
590590
"Warning: some configured include repos were not eligible for "
591-
"tracking (missing access, archived, forked, disabled, or no push "
592-
"access): "
591+
+ "tracking (missing access, archived, forked, disabled, or no push "
592+
+ "access): "
593593
+ ", ".join(missing_include)
594594
)
595595

@@ -636,8 +636,8 @@ def resolve_repositories(
636636
print("Error: no eligible repositories found for traffic collection.")
637637
print(
638638
"Check your config or token access. Explicit includes must be "
639-
"accessible, and automatic tracking excludes forks, archived repos, "
640-
"disabled repos, and repos without push access."
639+
+ "accessible, and automatic tracking excludes forks, archived repos, "
640+
+ "disabled repos, and repos without push access."
641641
)
642642
sys.exit(1)
643643

dashboard_action/runtime/scripts/release_notice.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ def parse_semver(value: str) -> SemVer | None:
4343
"""Parse a constrained semver string with an optional leading v."""
4444
match = re.match(
4545
r"^\s*v?(?P<major>0|[1-9]\d*)\."
46-
r"(?P<minor>0|[1-9]\d*)\."
47-
r"(?P<patch>0|[1-9]\d*)"
48-
r"(?:-(?P<prerelease>[0-9A-Za-z.-]+))?"
49-
r"(?:\+[0-9A-Za-z.-]+)?\s*$",
46+
+ r"(?P<minor>0|[1-9]\d*)\."
47+
+ r"(?P<patch>0|[1-9]\d*)"
48+
+ r"(?:-(?P<prerelease>[0-9A-Za-z.-]+))?"
49+
+ r"(?:\+[0-9A-Za-z.-]+)?\s*$",
5050
value,
5151
)
5252
if not match:

pyproject.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,17 @@ line-length = 100
4343
target-version = "py311"
4444

4545
[tool.ruff.lint]
46-
select = ["E4", "E7", "E9", "F"]
46+
select = ["E4", "E7", "E9", "F", "ISC"]
47+
48+
[tool.ruff.lint.flake8-implicit-str-concat]
49+
allow-multiline = false
50+
51+
[tool.ruff.lint.per-file-ignores]
52+
"dashboard_action/runtime/scripts/collect.py" = ["ISC002"]
53+
"dashboard_action/runtime/scripts/load_data.py" = ["ISC002"]
54+
"dashboard_action/runtime/scripts/readme_assets.py" = ["ISC002"]
55+
"dashboard_action/runtime/scripts/render_dashboard.py" = ["ISC002"]
56+
"dashboard_action/runtime/scripts/render_private_readme.py" = ["ISC002"]
57+
"dashboard_action/runtime/scripts/render_readme.py" = ["ISC002"]
58+
"dashboard_action/runtime/scripts/repo_config.py" = ["ISC002"]
59+
"scripts/validate_vendored_assets.py" = ["ISC002"]

0 commit comments

Comments
 (0)