PowerShell / PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
https://www.powershellgallery.com/packages/PSScriptAnalyzer/
MIT License
1.85k stars 375 forks source link

PSSCriptAnalyzer Needs Rule Sets #383

Open Jaykul opened 8 years ago

Jaykul commented 8 years ago

2015-11-26_20-20-19

We need rule sets for minimum safety, basic design, recommended design, etc. When you start bringing in rules like mandating named parameters or placement of curly braces, you are way past the point where you should have started collecting them into sets.

kilasuit commented 8 years ago

Agree - and there was a discussion on what these should be named - previously was Profiles (agreed bad name and therefore changed) but changed to configuration - which I very much disagree with due to configuration being a keyword and I would be more suggestive to rename this (again) to RuleSet

This is more generic and would be more better for discoverability with an additional about topic being packed with it

rkeithhill commented 8 years ago

Yeah given that the tool has "rules", ruleset is a better name than profile (which I think I might have proposed??). And I would like to see the "default" or "minimum" ruleset be something like the C# "Microsoft Basic Correctness Rules" or "Microsoft Managed Minimum Rules" ruleset.

PSScriptAnalyzer's default ruleset should contain only the rules that have a very high probably of indicating a real problem. I believe this will give the best "out of the box" experience and if users want more, well then the team should have more rulesets that the user can choose from.

kilasuit commented 8 years ago

This really needs to be called RuleSet as not to add further confusion to new user with core Keywords or Default variables as opposed to the current implementation which replaced profile with configuration

See https://github.com/PowerShell/PSScriptAnalyzer/issues/165 & https://github.com/PowerShell/PSScriptAnalyzer/pull/370

joeyaiello commented 8 years ago

Agreed with @kilasuit here. I apologize for missing the conversation on Profile vs. Configuration as I would have been in favor of leaving the original parameter name (i.e. Profile), given the fact it's a breaking change. However, since we haven't properly documented or implemented any yet, I would also be open to a breaking change on the parameter name, but Configuration is absolutely confusing as a PowerShell keyword.

Thoughts?

KirkMunro commented 8 years ago

I like RuleSet. If it looks like a duck and acts like a duck...

joeyaiello commented 8 years ago

Cool, we'll raise it on the call today and see if anyone has any objections.