-
Notifications
You must be signed in to change notification settings - Fork 394
Allow modules to provide rules #2103
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
Comments
I think it is definitely a good idea but probably not that easy to implement. Happy to accept contributions |
Out of curiosity, can you please clarify whether you want to:
|
short answer? yes. longer answer? great question! its actually both as they build upon each other:
what you essentially already have here is "load a module containing rules with scriptanalyzer" with extra steps. now doing this would also allow your second point to happen:
so: yes to define custom rules within a module that can be published/downloaded to/from psgallery and to allow those rules to be referenced and used to analyze scripts, for the development and validation of/within a specific PowerShell module project i hope this answers any questions :) |
Summary of the new feature
as a user/developer I would like to have rules be defined as a part of a module.
As it stands now, the only possibility i can see right now to import "custom" rules is via
CustomRulePath
, however documentation and testing leads me to believe this only supports a known static or relative path.Proposed technical implementation details (optional)
As a part of your documentation you talk about MEF, but this is possibly only for
CustomRulePath
? I can see as part of instance that you haveValidModPaths
, but it seemes to only have data appended by methods in reference toGetValidCustomRulePaths()
?Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord
?usingModules
to settings so you dont need to re-check all modules in current runspace, but just the ones defined by the userI want Scriptanalyzer to also check available rules from modules.
What is the latest version of PSScriptAnalyzer at the point of writing
1.24.0
The text was updated successfully, but these errors were encountered: