PowerShell / PowerShell/PSScriptAnalyzer
PSShouldProcess Rule and module specific adaption
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
Scenario
One of the default rules checks, whether a command that supports should process, actually uses ...
$PSCmdlet.ShouldProcess( ... )
Now, this is a great rule in principle, but in the framework module I maintain (https://psframework.org) I've got a cmdlet that replaces that method call (for readability and mocking reasons).
My current solution is to disable the specific script analyzer rule (PSShouldProcess) in my automatic tests. Which works well enough for my purposes.
But it would be more awesome if it were to detect the command and equate it with the method call (cause I'd actually appreciate having that check enabled, if it were practical).
Creating my own rule wouldn't be a problem, so my own projects would be covered. But since I'm trying to distribute this to others - with increasing success - distributing the custom rule to their tests would be ... inconvenient outside of PSScriptAnalyzer.
Questions
What's the policy on changes to rules that are module specific?
If I write that update, would it even be considered?
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
Comienza con la regla PSShouldProcess y las pruebas automáticas descritas en el issue; no se nombra ningún archivo de código fuente ni ninguna ruta de pruebas. Se consideraría terminado con una política concreta para los equivalentes de comandos específicos de cada módulo y un alcance de implementación acordado, seguido de pruebas que demuestren que la regla gestiona la adaptación propuesta.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, powershell
- Área
- tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 30/100