chore: sync tasks.json from template for Windows PowerShell compatibility#127
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughVS Code task definitions in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
☀️ Quality Summary 🚦 Unit Tests (GCC): 99% successful (✔️ 470 passed, 🙈 3 skipped) Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.vscode/tasks.json (2)
1-1: Remove the UTF-8 BOM at Line 1.The leading BOM (
) is unnecessary and can cause strict JSON tooling/parsing edge cases.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.vscode/tasks.json at line 1, Remove the leading UTF-8 BOM character (U+FEFF) at the start of the file so the first character is the JSON opening brace '{' (i.e., delete the invisible "" before '{'); save the file as UTF-8 without BOM so JSON parsers and strict tooling will parse the tasks JSON correctly.
29-32: Align Windows task presets with the environment-driven approach used on non-Windows platforms.The non-Windows tasks (lines 28, 43, 58) use
${env:BUILD_PRESET}to support all available presets (debug, release, sanitize, coverage, tidy, cppcheck, clang-debug, msvc-debug). The Windows overrides hardcodemsvc-debug, preventing Windows developers from using other configured workflows without editing tasks.json. Apply the same flexible pattern to Windows to maintain consistency.Suggested changes
"windows": { "command": "cmake", - "args": ["--preset", "msvc-debug"] + "args": ["--preset", "${env:BUILD_PRESET}"] } ... "windows": { "command": "cmake", - "args": ["--build", "--preset", "msvc-debug", "--target", "junit"] + "args": ["--build", "--preset", "${env:BUILD_PRESET}", "--target", "junit"] } ... "windows": { "command": "cmake", - "args": ["--build", "--preset", "msvc-debug", "--target", "clean"] + "args": ["--build", "--preset", "${env:BUILD_PRESET}", "--target", "clean"] }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.vscode/tasks.json around lines 29 - 32, The Windows task override hardcodes the CMake preset ("args": ["--preset", "msvc-debug"]) which breaks parity with the non-Windows tasks that use the environment variable; update the Windows "windows" task block where "command": "cmake" and "args" are defined to use the same environment-driven preset pattern (replace the literal "msvc-debug" with "${env:BUILD_PRESET}") so Windows developers can select any preset like debug, release, sanitize, coverage, tidy, cppcheck, clang-debug, or msvc-debug without editing tasks.json.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.vscode/tasks.json:
- Around line 11-13: The Windows task overrides in tasks.json (notably the
"build and test" task and the other Windows overrides) hardcode "msvc-debug" and
drop the fallback to running "behave Bdd/features/" when BUILD_PRESET is unset;
update the PowerShell command strings to check $env:BUILD_PRESET (or
${env:BUILD_PRESET}) and if empty run the BDD fallback, otherwise run cmake
--preset $env:BUILD_PRESET, then build and test using the same preset; replace
every occurrence of the hardcoded "msvc-debug" in the Windows overrides with the
env-aware conditional so Windows behavior matches the non-Windows tasks and
preserves the BDD fallback.
---
Nitpick comments:
In @.vscode/tasks.json:
- Line 1: Remove the leading UTF-8 BOM character (U+FEFF) at the start of the
file so the first character is the JSON opening brace '{' (i.e., delete the
invisible "" before '{'); save the file as UTF-8 without BOM so JSON parsers
and strict tooling will parse the tasks JSON correctly.
- Around line 29-32: The Windows task override hardcodes the CMake preset
("args": ["--preset", "msvc-debug"]) which breaks parity with the non-Windows
tasks that use the environment variable; update the Windows "windows" task block
where "command": "cmake" and "args" are defined to use the same
environment-driven preset pattern (replace the literal "msvc-debug" with
"${env:BUILD_PRESET}") so Windows developers can select any preset like debug,
release, sanitize, coverage, tidy, cppcheck, clang-debug, or msvc-debug without
editing tasks.json.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| "windows": { | ||
| "command": "cmake --preset msvc-debug; if ($?) { cmake --build --preset msvc-debug }; if ($?) { ctest --preset msvc-debug --verbose }" | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
python - <<'PY'
import json, pathlib
data = json.loads(pathlib.Path(".vscode/tasks.json").read_text(encoding="utf-8-sig"))
task = next(t for t in data["tasks"] if t.get("label") == "build and test")
win_cmd = task.get("windows", {}).get("command", "")
print("Windows command:", win_cmd)
print("Contains behave fallback:", "behave" in win_cmd)
print("Uses BUILD_PRESET env var:", "$env:BUILD_PRESET" in win_cmd)
PYRepository: DavidCozens/solid-syslog
Length of output: 271
🏁 Script executed:
cat -n .vscode/tasks.json | head -70Repository: DavidCozens/solid-syslog
Length of output: 2824
Windows build and test override removes behave BDD fallback and hardcodes preset, breaking behavior parity with non-Windows version.
Line 10 falls back to behave Bdd/features/ when BUILD_PRESET is unset; Line 12 always runs CMake with hardcoded msvc-debug and has no fallback. This is a functional change that can break the intended behavior on Windows when BUILD_PRESET is not configured.
Additionally, all Windows task overrides (lines 29–32, 44–47, 59–62) hardcode msvc-debug instead of respecting ${env:BUILD_PRESET}, reducing task flexibility inconsistently with non-Windows behavior.
Proposed fix (preserve Line 10 behavior in PowerShell)
"windows": {
- "command": "cmake --preset msvc-debug; if ($?) { cmake --build --preset msvc-debug }; if ($?) { ctest --preset msvc-debug --verbose }"
+ "command": "if (-not $env:BUILD_PRESET) { behave Bdd/features/ } else { cmake --build --preset $env:BUILD_PRESET; if ($?) { ctest --preset $env:BUILD_PRESET --verbose } }"
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "windows": { | |
| "command": "cmake --preset msvc-debug; if ($?) { cmake --build --preset msvc-debug }; if ($?) { ctest --preset msvc-debug --verbose }" | |
| }, | |
| "windows": { | |
| "command": "if (-not $env:BUILD_PRESET) { behave Bdd/features/ } else { cmake --preset $env:BUILD_PRESET; if ($?) { cmake --build --preset $env:BUILD_PRESET }; if ($?) { ctest --preset $env:BUILD_PRESET --verbose } }" | |
| }, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.vscode/tasks.json around lines 11 - 13, The Windows task overrides in
tasks.json (notably the "build and test" task and the other Windows overrides)
hardcode "msvc-debug" and drop the fallback to running "behave Bdd/features/"
when BUILD_PRESET is unset; update the PowerShell command strings to check
$env:BUILD_PRESET (or ${env:BUILD_PRESET}) and if empty run the BDD fallback,
otherwise run cmake --preset $env:BUILD_PRESET, then build and test using the
same preset; replace every occurrence of the hardcoded "msvc-debug" in the
Windows overrides with the env-aware conditional so Windows behavior matches the
non-Windows tasks and preserves the BDD fallback.
DavidCozens
left a comment
There was a problem hiding this comment.
BOM removed in latest push.
Regarding the hardcoded msvc-debug — this is deliberate and matches the template. On Windows only msvc-debug (and eventually msvc-release) are valid presets; the others (sanitize, coverage, tidy, cppcheck, clang-debug) are Linux-only. Using ${env:BUILD_PRESET} on Windows would break when the variable is unset or contains a Linux preset. The template intentionally hardcodes the Windows preset for this reason.
☀️ Quality Summary 🚦 Unit Tests (GCC): 99% successful (✔️ 470 passed, 🙈 3 skipped) Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result. |
Syncs .vscode/tasks.json from the CppUTestTemplate. Adds
windowsoverrides to all tasks so Ctrl+Shift+B works in PowerShell (replaces bash&&with; if ($?) { ... }chaining).Summary by CodeRabbit