PowerShell / PowerShell/PSScriptAnalyzer

Settings file needs to have a exclude / ignore mechanism

Offen
#1,230 5 Kommentare 9 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Area - Configuration Issue - Enhancement
Vorherrschende Sprache
C#
Sterne
2.2k
Forks
414
Ø Merge
13 Std. 1 Min.
Gemergte PRs (30 T.)
2

Beschreibung

**There needs to be an "exclude" option e.g. "exclude .tests.ps1" **

I have a module with ~ 200 pester tests attached. In VSCode if I attach a settings file the analyzer reports each pester command in each file is not found, by default, in each of the profiles where pester is not present. This reports so many false positives it is impossible to see the things which should be fixed. (VS code just says "> 1000 problems" and stops counting!)

Proposed technical implementation details (optional)

An option in the settings file (and perhaps on the command line) which said "exclude files which match this regular expression" would allow a subfolder, or certain names to be ignored. This is preferable to scanning those files, and trying to figure out which messages to hide, or having a mechanism for saying "Tell me if I'm using a module which isn't in V6 ... except don't tell me about Pester ... unless I've used it outside this folder" .

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, nachzuverfolgen, wie PSScriptAnalyzer Einstellungsdateien liest und Befehlszeilenoptionen verarbeitet. Ermittle, wo die Dateiauswahl erfolgt und wie ein Ausschlussmuster in beide Einstiegspunkte passen würde. Als erledigt gilt die Aufgabe, wenn Benutzer übereinstimmende Dateien ausschließen können, sodass deren Diagnosen nicht gemeldet werden, einschließlich der hier beschriebenen Pester-bezogenen False Positives.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
powershell
Bereich
cli, tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.