PowerShell / PowerShell/PSResourceGet

Add static code analysis

Open
#1,856 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Build&Release feature_request
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/code/Microsoft.PowerShell.PSResourceGet.csproj and review the proposed analysis properties and their current build behavior. Then inspect the repository's pull-request checks to determine where analysis should run. Done means static analysis is configured and pull requests cannot merge with errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ci-cd, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.