PowerShell / PowerShell/PSScriptAnalyzer
UseShouldProcessForStateChangingFunctions should prove that a function changes system state.
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
Right now, the UseShouldProcessForStateChangingFunctions rule only looks at the name of the function (the verb) in order to determine that the function changes system state.
I think the rule should look at the body of the function and see if the function uses other functions that changes system state before it issues a warning.
If not, then I think that functions with the "New" verb should not be considered as functions that change system state. A lot of functions from the community with the "New" verb do not change system state, but are actually just different forms of "New-Object". See, for example, the ShowUI module.
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
Comece pela regra UseShouldProcessForStateChangingFunctions e rastreie como ela usa atualmente os nomes das funções para emitir avisos. Investigue como a regra poderia inspecionar corpos e chamadas de funções, incluindo se as funções New-verb devem ser excluídas quando não alteram o estado do sistema. O trabalho estará concluído quando a regra distinguir funções que alteram o estado de funções de construção de objetos sem depender apenas do verbo.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- csharp, powershell
- Domínio
- devtools
- Tipo de issue
- Funcionalidade
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100