PowerShell / PowerShell/PSScriptAnalyzer
variable assignments are not aligned
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 2.2k
- Forks
- 414
- Merge medio
- 13 h 1 min
- PR fusionados (30 d)
- 2
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Ejecuta la reproducción proporcionada de PowerShell 5.1 con PSAlignAssignmentStatement habilitado, incluido CheckHashtable. Lee el comportamiento del formateador para esa regla y compara la alineación de las asignaciones y de las entradas de la tabla hash; se considera completado cuando las asignaciones de variables mostradas y los signos igual de las tablas hash están alineados de forma coherente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- powershell
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100