Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Enable Opting In to Failing on Required and Flagged PSSA Rules #161

Closed
PlagueHO opened this issue Jul 17, 2017 · 3 comments
Closed

Enable Opting In to Failing on Required and Flagged PSSA Rules #161

PlagueHO opened this issue Jul 17, 2017 · 3 comments

Comments

@PlagueHO
Copy link
Collaborator

Currently DSCResource.Tests ignores any PSSA required or flagged rules because:
| Automatically passing this test since it may break several resource modules at the moment. Automatic pass to be removed Jan-Feb 2017.

This was obviously meant to be removed in Jan-Feb 2017 but has not been.

What I propose is that we add some more Opt in settings:
Common Tests - Required Script Analyzer Rules
Common Tests - Flagged Script Analyzer Rules

If these are set then we skip this line:
https://github.com/PowerShell/DscResource.Tests/blob/dev/Meta.Tests.ps1#L377

or this line:
https://github.com/PowerShell/DscResource.Tests/blob/dev/Meta.Tests.ps1#L401

I noticed this when implementing #86 (custom PSSA rules for validating style guidelines). We'll need the ability to opt in to these custom PSSA rules as many resources will contain lots of violations - and we'll want these to be just notifications until a resource opts-in.

@johlju
Copy link
Contributor

johlju commented Jul 18, 2017

I'm happy they were not changed so they started to fail, because there is still a backlog in xSQLServer to fix these. :) It feels like we have fixed technical debt for more than half a year in that module.

So i'm all for these being opt-in!

@PlagueHO
Copy link
Collaborator Author

PlagueHO commented Feb 8, 2018

@johlju , @kwirkykat - do you have any objections to me progressing this one? Now that all the style rules are passing in the repos I support I'd like to be able to "enforce" this in all future PR's.

This would only be a year late 😆

I think the name of the following flags need to be implemented:

I can submit a PR once @johlju's current PR's are through.

@johlju
Copy link
Contributor

johlju commented Feb 8, 2018

@PlagueHO I'm all for this. I'm ready to opt-in for this in SqlServerDsc now as well. The default will be opt-out so this change wouldn't effect the current behavior.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants