PowerShell / PowerShell/PSScriptAnalyzer
variable assignments are not aligned
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- C#
- Estrelas
- 2.2k
- Forks
- 414
- Merge médio
- 13h 1min
- PRs com merge (30d)
- 2
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Execute a reprodução fornecida do PowerShell 5.1 com PSAlignAssignmentStatement habilitado, incluindo CheckHashtable. Leia o comportamento do formatador para essa regra e compare o alinhamento das atribuições e das entradas de tabela hash; considera-se concluído quando as atribuições de variáveis demonstradas e os sinais de igual das tabelas hash estiverem alinhados de forma consistente.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- powershell
- Domínio
- tooling
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Pouca atividade
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 52/100