Skip to content

Commit 2ab08be

Browse files
rtibblesbotclaude
andcommitted
fix: replace inner prek call with direct ruff in generate_from_specs
The rebuild-from-specs hook was failing in CI because the inner prek call (used to format generated files) did not properly set up hook environments in the CI context, leaving generated schema files with single-line repr() output that exceeded line length limits. Replace the inner prek call with direct ruff check/format calls on the generated Python files. Add ruff as a direct dev dependency so it's available in the venv. This is simpler and more reliable than depending on prek hook environments being properly initialized. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 31a1761 commit 2ab08be

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ test = [
3939
dev = [
4040
{ include-group = "test" },
4141
"prek ; python_version >= '3.8'",
42+
"ruff ; python_version >= '3.8'",
4243
]
4344

4445
[tool.uv]

scripts/generate_from_specs.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ def set_package_json_version():
310310

311311
output_files += set_package_json_version()
312312

313-
env = os.environ.copy()
314-
env["SKIP"] = "rebuild-from-specs"
315-
316-
subprocess.call(["prek", "run", "--files"] + output_files, env=env)
313+
py_files = [f for f in output_files if f.endswith(".py")]
314+
subprocess.call(["ruff", "check", "--fix"] + py_files)
315+
subprocess.call(["ruff", "format"] + py_files)

uv.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)