PowerShell / PowerShell/PSScriptAnalyzer
ValidateRange boundary type vs parameter type check
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 2.2k
- Forks
- 414
- Ø Merge
- 13 Std. 1 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
Summary of the new feature
For ValidateRange, check that the boundary type match the parameter types. The reason is that integer literals silently accepts values outside the declared range on [double], [float], [decimal] types
A clear and concise description of what the problem is that the new feature would solve.
Try formulating it in user story style (if applicable):
I wrote it up in this article
https://www.reddit.com/r/PowerShell/comments/1vbsyfc/til_validaterange_with_integer_literals_silently/
Proposed technical implementation details (optional)
A clear and concise description of what you want to happen.
I'd like to see the PSScriptAnalyzer highlight an inconsistency in types in the same way that it does for other errors.
This would be shown in the output list when you run it against a script.
What is the latest version of PSScriptAnalyzer at the point of writing
1.25
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Es werden keine Dateien oder Tests genannt. Beginne damit, die bestehende Behandlung von ValidateRange und die Tests der Analyzer-Regeln zu finden, und führe dann PSScriptAnalyzer für Beispiele mit ganzzahligen Grenzen und double-, float- oder decimal-Parametern aus. Erledigt ist die Aufgabe, wenn die Inkonsistenz eine Analyzer-Diagnose erzeugt und die gemeldeten Fälle abgedeckt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, powershell
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 52/100