Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions scripts/harness_checks/line_count_baseline.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"hard_cap": 3000,
"warn_cap": 1500,
"root": "harness-discipline-docs",
"offenders": {
"src/spark_cli/cli.py": 18105,
"src/spark_cli/system_map.py": 5658,
"tests/test_cli.py": 14759,
"tests/test_system_map.py": 2055
}
}
"hard_cap": 3000,
"warn_cap": 1500,
"root": "harness-discipline-docs",
"offenders": {
"src/spark_cli/cli.py": 18111,
"src/spark_cli/system_map.py": 5658,
"tests/test_cli.py": 14759,
"tests/test_system_map.py": 2055
},
"src/spark_cli/cli.py": 18111
}
6 changes: 4 additions & 2 deletions src/spark_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3456,7 +3456,8 @@ def spark_builder_home() -> Path:

def write_generated_env(path: Path, values: dict[str, str]) -> None:
require_write_allowed(path, subject="generated module env write")
lines = [f"{key}={value}" for key, value in values.items()]
sanitized = {key: value.replace("\n", "").replace("\r", "") for key, value in values.items()}
lines = [f"{key}={value}" for key, value in sanitized.items()]
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text("\n".join(lines) + "\n", encoding="utf-8")
# Generated module env files hold control-plane keys (SPARK_BRIDGE_API_KEY,
Expand Down Expand Up @@ -4891,7 +4892,8 @@ def update_env_file(path: Path, values: dict[str, str]) -> None:
lines.append("")
lines.append(start)
for key, value in values.items():
lines.append(f"{key}={value}")
sanitized = value.replace("\n", "").replace("\r", "")
lines.append(f"{key}={sanitized}")
lines.append(end)
# Atomic write: write to a unique temp path, chmod to private mode, then
# os.replace into place so a concurrent reader never observes a half-written
Expand Down
Loading