Skip to content

Add static code analysis #1856

@o-l-a-v

Description

@o-l-a-v

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>?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions