PowerShell / PowerShell/PSScriptAnalyzer
Revise semantics of compatibility rule profile inclusion
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- C#
- Estrelas
- 2.2k
- Forks
- 415
- Merge médio
- 13h 1min
- PRs com merge (30d)
- 2
Descrição
UseCompatibleCommands and UseCompatibleTypes create a "union" profile for comparison of target profiles to a base standard. This allows us to use simple heuristic to determine whether a PowerShell AST represents something that is platform-specific (we see if the command or type is available in any platform, and if not ignore it as user-defined).
The problem here is that to create good warnings we have to have a good baseline union profile. Meaning we need to be judicious about how we make the profile. But since we could get it wrong, I created an informal mechanism for including things into the union profile. We use all the profiles in the "profile directory" and nothing else:
This means that:
- Including only one target, you still get good warnings, because it's compared against all the other profiles we ship by default
- Using a target not in the profile directory, that won't be included in the union comparison
- You can configure a different profile directory to get rid of comparisons to PowerShells you don't care about
This works but it's a bit subtle. I think we should move to:
- All targets are in the union by default
- Targets in the profile directory are in the union by default
- Targets can be excluded from the union in a configuration setting, by name or path
- The profile directory automatic union inclusion can be turned off by default
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 por CompatibilityProfileLoader.cs, especialmente pela lógica de carregamento do diretório de perfis vinculada na issue, e rastreie como UseCompatibleCommands e UseCompatibleTypes constroem o perfil de união. Defina o comportamento de configuração e exclusão para destinos nomeados ou baseados em caminho e para desabilitar a inclusão automática do diretório de perfis. O trabalho estará concluído quando todos os destinos forem incluídos por padrão e as exclusões configuradas e a configuração de opt-out forem respeitadas.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- csharp, powershell
- Domínio
- devtools, tooling
- Tipo de issue
- Funcionalidade
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 30/100