Skip to content

chore: sync tasks.json from template for Windows PowerShell compatibility#127

Merged
DavidCozens merged 2 commits into
mainfrom
chore/sync-tasks-json-from-template
Apr 15, 2026
Merged

chore: sync tasks.json from template for Windows PowerShell compatibility#127
DavidCozens merged 2 commits into
mainfrom
chore/sync-tasks-json-from-template

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Apr 15, 2026

Copy link
Copy Markdown
Owner

Syncs .vscode/tasks.json from the CppUTestTemplate. Adds windows overrides to all tasks so Ctrl+Shift+B works in PowerShell (replaces bash && with ; if ($?) { ... } chaining).

Summary by CodeRabbit

  • Chores
    • Improved task runner configuration: better Windows support and explicit Windows command overrides.
    • Swapped and renamed two build/test tasks to clarify their roles (configure vs test), reorganizing which task is grouped as build or test.
    • Made the combined build-and-test flow conditional (stop on failure) and enabled verbose test output.
    • Added Windows-specific clean command and minor formatting fix.

@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd61121c-5101-4ce3-8a60-849f1bcab403

📥 Commits

Reviewing files that changed from the base of the PR and between a54d6e7 and 2b7f8ba.

📒 Files selected for processing (1)
  • .vscode/tasks.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • .vscode/tasks.json

📝 Walkthrough

Walkthrough

VS Code task definitions in .vscode/tasks.json were updated: the "configure" and "test (junit)" tasks swapped labels and underlying commands/groups, Windows-specific command overrides were added for build/test/clean tasks, and a trailing newline was added.

Changes

Cohort / File(s) Summary
VS Code Tasks Configuration
​.vscode/tasks.json
Swapped labels/groups and swapped functionality between the configure and test (junit) tasks (configure→build junit, test (junit)→configure). Added Windows-specific windows overrides for the build-and-test task, junit build task, configure task, and clean task. Added a trailing newline.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop, a swap, the tasks align,
Configure turns to test, then twine,
Windows whispers commands anew,
Clean and build in ordered queue,
I nibble code and hum — review!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is brief but addresses the core purpose and change. However, it omits several template sections including Test Evidence and Areas Affected. Consider expanding the description to address Purpose, Test Evidence, and Areas Affected sections from the template for better completeness.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: syncing tasks.json from template to add Windows PowerShell compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sync-tasks-json-from-template

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   Unit Tests (GCC): 99% successful (✔️ 470 passed, 🙈 3 skipped)
   🚦   Unit Tests (Clang): 99% successful (✔️ 437 passed, 🙈 3 skipped)
   🚦   Unit Tests (Sanitize): 99% successful (✔️ 437 passed, 🙈 3 skipped)
   🚦   BDD Tests: 100% successful (✔️ 31 passed)
   🚦   Unit Tests (MSVC): 100% successful (✔️ 338 passed, 🙈 1 skipped)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 hardcode msvc-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

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 32abdee1-2e3e-48a1-86fb-ab2a37ffc41d

📥 Commits

Reviewing files that changed from the base of the PR and between c32aff2 and a54d6e7.

📒 Files selected for processing (1)
  • .vscode/tasks.json

Comment thread .vscode/tasks.json
Comment on lines +11 to +13
"windows": {
"command": "cmake --preset msvc-debug; if ($?) { cmake --build --preset msvc-debug }; if ($?) { ctest --preset msvc-debug --verbose }"
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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)
PY

Repository: DavidCozens/solid-syslog

Length of output: 271


🏁 Script executed:

cat -n .vscode/tasks.json | head -70

Repository: 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.

Suggested change
"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 DavidCozens left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   Unit Tests (GCC): 99% successful (✔️ 470 passed, 🙈 3 skipped)
   🚦   Unit Tests (Clang): 99% successful (✔️ 437 passed, 🙈 3 skipped)
   🚦   Unit Tests (Sanitize): 99% successful (✔️ 437 passed, 🙈 3 skipped)
   🚦   BDD Tests: 100% successful (✔️ 31 passed)
   🚦   Unit Tests (MSVC): 100% successful (✔️ 338 passed, 🙈 1 skipped)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@DavidCozens DavidCozens merged commit 4af699d into main Apr 15, 2026
12 checks passed
@DavidCozens DavidCozens deleted the chore/sync-tasks-json-from-template branch April 15, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant