PowerShell / PowerShell/PSScriptAnalyzer

Normalisation of new lines after pipes in expressions with 2 or more pipes

Aperta
#1,755 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Area - Formatter Issue - Enhancement
Lingua principale
C#
Stelle
2.2k
Fork
414
Merge medio
13h 1m
PR unite (30g)
2

Descrizione

Summary of the new feature

Consider the following

$List | Where-Object {
} |
    ForEach-Object {
    }

This is a formatted piece of PowerShell with the notable feature of using both no new line after the pipe and new line after the pipe. The new rule would normalise the presence of a new line after a pipe across the input data.
The rule would have the option to enforce new lines or enforce no new lines after a pipe.

For example,

$List | Where-Object {
} |
    ForEach-Object {
    }

would become

$List | Where-Object {
} | ForEach-Object {
}

If there only exists one pipe, then removing a Newline pending its line length could also be within the scope of the feature.

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

PS > (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.19.1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

La issue non indica file, test o punti di ingresso; inizia individuando il punto di ingresso del formatter responsabile della gestione dei ritorni a capo dopo i pipe. Usa gli esempi forniti con ritorni a capo misti per definire la normalizzazione prevista e chiarire se la regola si applica ai pipe singoli e ai limiti di lunghezza delle righe. L’attività è completata quando l’opzione di enforcement selezionata produce un output coerente e il suo comportamento è coperto da test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.