Skip to content

Commit e9c4d96

Browse files
wphillipmoorewphillipmoore-claude
andauthored
fix: scope Python linters to src/ and tests/, sync standard-tooling v1.1.4 (#352)
Exclude scripts/ from ruff to avoid conflicts with centrally managed standard-tooling scripts. Remove now-unnecessary per-file-ignores for scripts/. Sync all shared scripts from standard-tooling v1.1.4. Co-authored-by: wphillipmoore-claude <255925739+wphillipmoore-claude@users.noreply.github.com>
1 parent f551766 commit e9c4d96

19 files changed

Lines changed: 75 additions & 16 deletions

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pymqrest = ["py.typed", "mapping-data.json"]
6464
line-length = 120
6565
target-version = "py312"
6666
src = ["src", "tests"]
67-
extend-exclude = ["docs/archive"]
67+
extend-exclude = ["docs/archive", "scripts"]
6868

6969
[tool.ruff.lint]
7070
select = ["ALL"]
@@ -90,10 +90,6 @@ docstring-quotes = "double"
9090
"S105", # Hardcoded test passwords are expected in test fixtures.
9191
"S106", # Hardcoded test password arguments are expected in test fixtures.
9292
]
93-
"scripts/**/*.py" = [
94-
"D1", # Internal tooling scripts do not require docstrings.
95-
"T201", # Scripts use print for user-facing output.
96-
]
9793
"examples/**/*.py" = [
9894
"INP001", # Example scripts are not a package; no __init__.py needed.
9995
"T201", # Example scripts use print for user-facing output.

scripts/dev/commit.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env bash
2+
# Managed by standard-tooling — DO NOT EDIT in downstream repos.
3+
# Canonical source: https://github.com/wphillipmoore/standard-tooling
24
# Commit wrapper that constructs standards-compliant commit messages.
35
# Resolves Co-Authored-By identities from docs/repository-standards.md.
46

scripts/dev/finalize_repo.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env bash
2+
# Managed by standard-tooling — DO NOT EDIT in downstream repos.
3+
# Canonical source: https://github.com/wphillipmoore/standard-tooling
24
set -euo pipefail
35

46
# Finalize a repository after a PR merge: switch to the target branch,

scripts/dev/prepare_release.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env python3
2+
# Managed by standard-tooling — DO NOT EDIT in downstream repos.
3+
# Canonical source: https://github.com/wphillipmoore/standard-tooling
24
"""Automate release preparation: branch, changelog, PR, auto-merge.
35
46
Shared script for library repositories using the library-release branching
@@ -207,10 +209,10 @@ def merge_main(version: str) -> None:
207209

208210

209211
def generate_changelog(version: str) -> bool:
210-
"""Generate changelog via git-cliff if available. Return True if generated."""
211-
if not shutil.which("git-cliff"):
212-
print("git-cliff not found, skipping changelog generation.")
213-
return False
212+
"""Generate changelog via git-cliff. Return True if generated."""
213+
for tool in ("git-cliff", "markdownlint"):
214+
if not shutil.which(tool):
215+
raise SystemExit(f"Required tool '{tool}' not found. Install it before releasing.")
214216
tag = f"develop-v{version}"
215217
print(f"Generating changelog with boundary tag: {tag}")
216218
run_command(("git-cliff", "--tag", tag, "-o", "CHANGELOG.md"))
@@ -219,6 +221,18 @@ def generate_changelog(version: str) -> bool:
219221
changelog.read_text(encoding="utf-8").rstrip() + "\n",
220222
encoding="utf-8",
221223
)
224+
result = subprocess.run(
225+
("markdownlint", "CHANGELOG.md"),
226+
capture_output=True,
227+
text=True,
228+
)
229+
if result.returncode != 0:
230+
print(result.stdout)
231+
print(result.stderr)
232+
raise SystemExit(
233+
"CHANGELOG.md failed markdownlint validation. "
234+
"Fix cliff.toml template or CHANGELOG content before releasing."
235+
)
222236
run_command(("git", "add", "CHANGELOG.md"))
223237
status = read_command_output(("git", "status", "--porcelain"))
224238
if not status:

scripts/dev/submit-pr.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env bash
2+
# Managed by standard-tooling — DO NOT EDIT in downstream repos.
3+
# Canonical source: https://github.com/wphillipmoore/standard-tooling
24
# PR submission wrapper that constructs standards-compliant PR bodies.
35
# Populates .github/pull_request_template.md programmatically.
46

scripts/dev/sync-tooling.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env bash
2+
# Managed by standard-tooling — DO NOT EDIT in downstream repos.
3+
# Canonical source: https://github.com/wphillipmoore/standard-tooling
24
set -euo pipefail
35

46
# sync-tooling.sh — keep local copies of shared scripts in sync with
@@ -110,7 +112,7 @@ if [[ -n "$ref" ]]; then
110112
else
111113
# Discover the latest tag without a full clone.
112114
clone_ref="$(git ls-remote --tags --sort=-v:refname "$TOOLING_REPO" 'v*' \
113-
| head -n 1 | sed 's|.*refs/tags/||')"
115+
| head -n 1 | sed 's|.*refs/tags/||; s|\^{}$||')"
114116
if [[ -z "$clone_ref" ]]; then
115117
echo "ERROR: no tags found in $TOOLING_REPO" >&2
116118
exit 1

scripts/dev/validate_local.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
2-
# Canonical source: standard-tooling
2+
# Managed by standard-tooling — DO NOT EDIT in downstream repos.
3+
# Canonical source: https://github.com/wphillipmoore/standard-tooling
34
# validate_local.sh — shared driver for pre-PR local validation.
45
#
56
# Reads primary_language from docs/repository-standards.md, then runs:

scripts/dev/validate_local_common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
2-
# Canonical source: standard-tooling
2+
# Managed by standard-tooling — DO NOT EDIT in downstream repos.
3+
# Canonical source: https://github.com/wphillipmoore/standard-tooling
34
# validate_local_common.sh — shared checks run for ALL repos.
45
set -euo pipefail
56

scripts/dev/validate_local_go.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
2-
# Canonical source: standard-tooling
2+
# Managed by standard-tooling — DO NOT EDIT in downstream repos.
3+
# Canonical source: https://github.com/wphillipmoore/standard-tooling
34
# validate_local_go.sh — Go-specific local validation checks.
45
set -euo pipefail
56

scripts/dev/validate_local_java.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
2-
# Canonical source: standard-tooling
2+
# Managed by standard-tooling — DO NOT EDIT in downstream repos.
3+
# Canonical source: https://github.com/wphillipmoore/standard-tooling
34
# validate_local_java.sh — Java-specific local validation checks.
45
set -euo pipefail
56

0 commit comments

Comments
 (0)