Repository navigation
chore: Add VS Code recommended extensions, settings, and build tasks #465
Description
Summary
The repository has no .vscode/ folder. Add the standard VS Code workspace configuration files used across DSC Community modules (aligned with SqlServerDsc) to provide a consistent developer experience for all contributors.
Files to create
.vscode/extensions.json
Recommended extensions for contributors:
{
"recommendations": [
"davidanson.vscode-markdownlint",
"pspester.pester-test",
"ms-vscode.powershell",
"streetsidesoftware.code-spell-checker"
]
}.vscode/tasks.json
Replace the minimal workspace tasks with a comprehensive set aligned to the build.yaml workflow tasks. All tasks should use ./build.ps1 (not &${cwd}/build.ps1) and target pwsh on Linux/macOS and powershell.exe on Windows.
Tasks to include:
| Label | Build group | Command | Notes |
|---|---|---|---|
noop |
— | ./build.ps1 -Tasks noop |
Resolves and restores dependencies; run once per pwsh session before testing |
build |
build (default) | ./build.ps1 -AutoRestore -Tasks build |
Full module build |
test |
test (default) | ./build.ps1 -Tasks noop; Invoke-Pester -Path './tests/Unit' -Output Detailed |
Unit tests without coverage |
test-with-coverage |
test | ./build.ps1 -Tasks noop; Invoke-Pester -Path './tests/Unit' -Output Detailed with coverage enabled |
Unit tests with code coverage |
hqrmtest |
— | ./build.ps1 -AutoRestore -Tasks hqrmtest -CodeCoverageThreshold 0 |
High Quality Resource Module (HQRM) QA tests |
Each task should include:
- A
problemMatcherfor surfacing Pester failures in the VS Code Problems panel "panel": "new"forbuild;"panel": "dedicated"for test tasks"focus": trueand"reveal": "always"onpresentation
Use the tasks.json from SqlServerDsc as the reference and adapt the test task commands for this module's test path structure (tests/Unit/DSCResources/ and tests/Unit/Classes/ instead of tests/Unit/Public/, tests/Unit/Private/, etc.).
.vscode/settings.json
Workspace settings to enforce consistent formatting and tooling. Base on the SqlServerDsc settings.json and adapt:
- PowerShell code formatting —
openBraceOnSameLine: false,newLineAfterOpenBrace: true, 4-space indent,preset: Custometc. - PSScriptAnalyzer —
powershell.scriptAnalysis.settingsPathpointing to.vscode/analyzersettings.psd1 - Pester integration —
pester.testFilePathpatterns coveringtests/Unit/**/*.Tests.ps1andtests/QA/*.Tests.ps1;pester.pesterModulePath: ./output/RequiredModules/Pester;pester.runTestsInNewProcess: true;powershell.pester.useLegacyCodeLens: false - GitHub Copilot —
github.copilot.chat.codeGeneration.useInstructionFiles: true - Editor —
files.trimTrailingWhitespace: true,files.insertFinalNewline: true,files.trimFinalNewlines: true - cSpell —
cSpell.dictionaries: ["powershell"]with project-specific word list cleaned of SQL Server terms; add ComputerManagementDsc-relevant words - Markdownlint —
markdownlint.ignore: [".github/CODEOWNERS"] - Terminal profiles — default to
pwshon Linux/macOS/Windows for consistent behavior with Copilot agent terminal
Remove all SQL Server–specific cSpell.words and cSpell.ignoreRegExpList entries from the SqlServerDsc source.
.vscode/analyzersettings.psd1
PSScriptAnalyzer settings file for the PowerShell extension's inline analysis. Base on the SqlServerDsc analyzersettings.psd1 and adapt:
CustomRulePath— keep./output/RequiredModules/DscResource.AnalyzerRulesand./output/RequiredModules/Indented.ScriptAnalyzerRules; remove the SqlServerDsc-specific./tests/QA/AnalyzerRules/SqlServerDsc.AnalyzerRules.psm1entry (or replace with the equivalent path if this repo has custom analyzer rules)IncludeDefaultRules: $true- Keep the full
IncludeRuleslist of DSC Community standard rules (both default PSScriptAnalyzer rules and DSC-specific rules) - Keep the
Ruleshashtable forPSUseConsistentWhitespace,PSPlaceOpenBrace,PSPlaceCloseBrace,PSAlignAssignmentStatement
Acceptance criteria
-
.vscode/extensions.jsoncreated with the four recommended extensions -
.vscode/tasks.jsoncreated withnoop,build,test,test-with-coverage, andhqrmtesttasks -
.vscode/tasks.jsontest task paths reflect this repo's unit test folder layout (tests/Unit/DSCResources/,tests/Unit/Classes/) -
.vscode/settings.jsoncreated with PowerShell formatting, Pester, cSpell, Copilot instruction files, and terminal profile settings -
.vscode/settings.jsoncontains no SQL Server–specific words or patterns -
.vscode/analyzersettings.psd1created with DSC Community analyzer rules; no SqlServerDsc-specific custom rule path
References
- SqlServerDsc
.vscode/folder: https://github.com/dsccommunity/SqlServerDsc/tree/main/.vscode build.yamltask definitions in this repo
Activity