Skip to content

PSProvideCommentHelp should not generate informational messages for functions internal to a module #199

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

Closed
KirkMunro opened this issue May 22, 2015 · 0 comments

Comments

@KirkMunro
Copy link
Contributor

Today when I run Invoke-ScriptAnalyzer against my DoPx module, 5 informational messages are generated for the PSProvideCommentHelp rule indicating that I should provide comment-based help for the 5 functions that were discovered by this rule. Those are false positives, because the 5 functions in question are internal to my module, not exposed externally at all, and therefore they do not need comment-based help.

This issue raises another limitation with Invoke-ScriptAnalyzer: today it is written specifically for paths. It should have a parameter set that is for modules, so that you can just pass it a module name and have it analyze the entire module. This is important for a few obvious reasons:

  • modules have their own criteria when it comes to many rules like this one
  • modules have need for rules that are specific to them

With that in mind, the following changes should be made:

  1. A parameter set should be added to Invoke-ScriptAnalyzer that takes a ModuleInfo parameter (with pipeline input by value) so that you can invoke Get-Module ... | Invoke-ScriptAnalyzer to run it against a module.
  2. A ModuleName parameter set should be added to allow users to invoke Invoke-ScriptAnalyzer -ModuleName ....
  3. The PSProvideCommentHelp rule should not generate messages against functions that are not exported from a module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants