-
Notifications
You must be signed in to change notification settings - Fork 395
Add suggested corrections to allow violation fixes #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The class does not implement IScriptExtent interface anymore. The purpose of CorrectionExtent is to emit violation extent and the correction text but this behaviour is not consistent with the IScriptExtent interface.
Moves the module manifest testing logic to a separate method in the Helper class. This will enable reuse of the functionality by other rules.
Suggest corrections to FunctionsToExport and AliasesToExport when their values are set to '*' or '$null', e.g., FunctionsToExport = '*'. This does not support wildcard in an array, eg @('Set-Foo', 'Get-*').
Sets the path of the test helper module correctly.
README.md, line 197 [r1] (raw file): Comments from Reviewable |
Reviewed 23 of 23 files at r1. Comments from Reviewable |
Reviewed 1 of 1 files at r2. Comments from Reviewable |
Comments from Reviewable |
@raghushantha Thanks! |
Review status: all files reviewed at latest revision, 13 unresolved discussions, all commit checks successful. Engine/Helper.cs, line 238 [r2] (raw file): Engine/Helper.cs, line 243 [r2] (raw file): Engine/Helper.cs, line 244 [r2] (raw file): Engine/Helper.cs, line 257 [r2] (raw file): Engine/Helper.cs, line 277 [r2] (raw file): Engine/Generic/DiagnosticRecord.cs, line 100 [r2] (raw file): Rules/AvoidAlias.cs, line 79 [r2] (raw file): Rules/AvoidAlias.cs, line 81 [r2] (raw file): Rules/AvoidUsingPlainTextForPassword.cs, line 76 [r2] (raw file): [string] [Parameter(ValueFromPipeline)] $Password It would also remove comments: [string] <#whatever#> $Password I think it's smart to use the parameter extent to show what gets "fixed", but more care is needed to replace only what you mean to. Rules/MissingModuleManifestField.cs, line 47 [r2] (raw file): Rules/MissingModuleManifestField.cs, line 51 [r2] (raw file): Rules/UseToExportFieldsInManifest.cs, line 36 [r2] (raw file): Rules/UseToExportFieldsInManifest.cs, line 100 [r2] (raw file): Comments from Reviewable |
Review status: all files reviewed at latest revision, 14 unresolved discussions. Tests/Rules/UseToExportFieldsInManifest.tests.ps1, line 89 [r2] (raw file):
Comments from Reviewable |
This implementation correctly handles PowerShell escape sequences that IndexOf cannot.
Handles the following cases * [string] [Parameter(ValueFromPipeline)] $Password * [Parameter(ValueFromPipeline)] $Password * [Parameter(ValueFromPipeline)] [string[]] $Password * [string] <#whatever#> $Password
* Doesn't check for VariablesToExport * Adds ability to wrap around correction string
Adds exception handling for a particular case in GetModuleManifest method
Review status: all files reviewed at latest revision, 14 unresolved discussions. Engine/Helper.cs, line 238 [r2] (raw file): Engine/Helper.cs, line 243 [r2] (raw file): Rules/MissingModuleManifestField.cs, line 51 [r2] (raw file): Tests/Rules/UseToExportFieldsInManifest.tests.ps1, line 89 [r2] (raw file): Comments from Reviewable |
This change is