PowerShell / PowerShell/PSScriptAnalyzer
variable assignments are not aligned
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 2.2k
- Fork
- 414
- Merge medio
- 13h 1m
- PR unite (30g)
- 2
Descrizione
After executing the following code, the = in variable assignments are not aligned, and the = in the first hashtable are also not aligned. I tested this in PowerShell 5.1 on Windows 10.
cls
$s = @'
$hashtable = @{ property1 ="value"
anotherProperty= "another value"
}
$hashtable = @{
property1 = "value"
anotherProperty = "another value"
}
$hashtable = @{
property1 = "value"
anotherProperty = "another value"
}
$a= "hello"
$ccc = "world"
$b="Hi"
function foo {
"hello"
}
'@
$settings = @{
IncludeRules = @("PSPlaceOpenBrace", "PSUseConsistentIndentation", "PSUseConsistentWhitespace","PSAlignAssignmentStatement")
Rules = @{
PSPlaceOpenBrace = @{
Enable = $true
OnSameLine = $false
}
PSUseConsistentIndentation = @{
Enable = $true
Kind = 'tab' # space,tab
IndentationSize = 1
PipelineIndentation = 'NoIndentation'
}
PSAlignAssignmentStatement = @{
Enable = $true
CheckHashtable = $true
}
}
}
Invoke-Formatter -ScriptDefinition $s -Settings $settings
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Esegui la riproduzione fornita di PowerShell 5.1 con PSAlignAssignmentStatement abilitato, incluso CheckHashtable. Leggi il comportamento del formatter per questa regola e confronta l’allineamento delle assegnazioni e delle voci della tabella hash; il lavoro è completato quando le assegnazioni delle variabili mostrate e i segni di uguale delle tabelle hash sono allineati in modo coerente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- powershell
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100