PowerShell / PowerShell/PSScriptAnalyzer

Should SuppressAzurePowerShellBreakingChangeWarnings throw UseDeclaredVarsMoreThanAssignments by default?

Open
#1,579 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Configuration Issue - Enhancement
Dominant language
C#
Stars
2.2k
Forks
414
Avg merge
13h 1m
Merged PRs (30d)
2

Description

Summary of the new feature

Currently $SuppressAzurePowerShellBreakingChangeWarnings variable warns with UseDeclaredVarsMoreThanAssignments however $WhatIfPreference does not.

Should this be added to default list of ignore rules or too specific to Az Powershell cmdlets?

https://github.com/Azure/azure-powershell/blob/master/documentation/breaking-changes/breaking-changes-messages-help.md

https://github.com/Azure/azure-powershell/blob/preview/documentation/breaking-changes/breaking-changes-definition.md

Proposed technical implementation details (optional)

Add this to list of default exceptions for UseDeclaredVarsMoreThanAssignments rule in Engine/SpecialVars.cs.

What is the latest version of PSScriptAnalyzer at the point of writing

v1.19.1

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

Read Engine/SpecialVars.cs and the linked breaking-change definition and messages documentation. Check how the default exceptions for UseDeclaredVarsMoreThanAssignments are represented, then verify the expected treatment of SuppressAzurePowerShellBreakingChangeWarnings against the existing rule behavior. Done means the default-list decision is implemented and covered by the relevant analyzer tests, if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.