Skip to content

chore: Add VS Code recommended extensions, settings, and build tasks #543

Description

@PlagueHO

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

Comprehensive tasks aligned to the build.yaml workflow. All tasks should use ./build.ps1 and target pwsh on Linux/macOS and powershell.exe on Windows.

Tasks to include:

Label Build group Command
noop ./build.ps1 -Tasks noop
build build (default) ./build.ps1 -AutoRestore -Tasks build
test test (default) ./build.ps1 -Tasks noop; Invoke-Pester -Path './tests/Unit' -Output Detailed
test-with-coverage test Unit tests with code coverage enabled
hqrmtest ./build.ps1 -AutoRestore -Tasks hqrmtest -CodeCoverageThreshold 0

Each task should include a problemMatcher for Pester failures, appropriate presentation settings, and correct shell configuration per platform.

Use SqlServerDsc tasks.json as the reference and adapt test task paths to tests/Unit/DSCResources/.


.vscode/settings.json

Based on SqlServerDsc settings.json, adapted for NetworkingDsc:

  • PowerShell code formatting (openBraceOnSameLine: false, preset: Custom, etc.)
  • PSScriptAnalyzer path: .vscode/analyzersettings.psd1
  • Pester: pester.testFilePath covering tests/Unit/**/*.Tests.ps1 and tests/QA/*.Tests.ps1; pester.pesterModulePath: ./output/RequiredModules/Pester; pester.runTestsInNewProcess: true
  • github.copilot.chat.codeGeneration.useInstructionFiles: true
  • Editor: files.trimTrailingWhitespace, files.insertFinalNewline, files.trimFinalNewlines
  • cSpell with powershell dictionary and NetworkingDsc-relevant words (no SQL Server terms)
  • Terminal profiles defaulting to pwsh

.vscode/analyzersettings.psd1

Based on SqlServerDsc analyzersettings.psd1:

  • CustomRulePath: ./output/RequiredModules/DscResource.AnalyzerRules and ./output/RequiredModules/Indented.ScriptAnalyzerRules; remove the SqlServerDsc-specific custom rule path
  • Full DSC Community IncludeRules list
  • Rules hashtable for whitespace, brace, and alignment rules

Acceptance criteria

  • .vscode/extensions.json created with the four recommended extensions
  • .vscode/tasks.json created with noop, build, test, test-with-coverage, and hqrmtest tasks
  • .vscode/tasks.json test task paths reflect tests/Unit/DSCResources/
  • .vscode/settings.json created with no SQL Server–specific words or patterns
  • .vscode/analyzersettings.psd1 created with DSC Community analyzer rules

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions