PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Add static code analysis

Open o-l-a-v opened this issue 5 months ago • 0 comments

Summary of the new feature / enhancement

The project does not seem to use any static code analysis.

Adding this would increase code quality and maintainability.

Other Microsoft PowerShell projects has it, like PowerShell itself.

Proposed technical implementation details (optional)

When coding

Add some config to src/code/Microsoft.PowerShell.PSResourceGet.csproj. I tested by adding this:

  <PropertyGroup>
    <EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <AnalysisLevel>8</AnalysisLevel>
    <AnalysisMode>Minimum</AnalysisMode>
  </PropertyGroup>

For PRs

Analyse on PRs, must have no errors before merge. Maybe by <EnforceCodeStyleInBuild>?

o-l-a-v avatar Aug 13 '25 09:08 o-l-a-v