Allow rules to be versioned #896
Replies: 3 comments
-
@ArmaanMcleod Thoughts? Working through this. I don't feel there is a good enough use case for this currently. If you look at other static analysis tools such as Roslyn, ESLint, or PSScriptAnalyzer there is not concept of rule versioning. It's either a rule or not. New rules have a new name/ ID. To round out the PSRule implementation we may want to implement marking a rule as disabled or obsolete. |
Beta Was this translation helpful? Give feedback.
-
@BernieWhite I've also thought about this as well and struggle to see a practical usecase. For me atleast I would probably not add versions to my rules since it would get difficult to manage them and make sure minor and patch versions are backwards compatible, assuming semantic versioning is used. If we had two rules like One situation I could see this being useful is not requiring new rule versions to be added incrementally to the name like Perhaps we could open a discussion and see if anyone would find this useful? |
Beta Was this translation helpful? Give feedback.
-
@ArmaanMcleod Good idea. |
Beta Was this translation helpful? Give feedback.
-
Currently each rule can be created and updated. While rules can be named independently to identify the version of the rule there is no explicit support for versioning a rule and selecting a rule version.
For example:
Rule Id would be updated to be
.\Rule1@1
orModule\Rule1@1
.Potentially a semver version could be used. but there may be little or no benefits if we assume semver that a minor or patch versions are backward compatible. If this is true, why would a separate rule with a minor or patch version increment be created?
When using rules in baselines, by name or dependency we need to have a consistent behaviour about selecting the rule version, like select the latest unless specified.
Beta Was this translation helpful? Give feedback.
All reactions