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

Commit

Permalink
Add opt-Ins flags to enable failing PSSA tests to fail build - Fixes #…
Browse files Browse the repository at this point in the history
…161 (#215)

* Added new Opt-In settings for Script Analyzer enforcement

* Changes as per PR comments

* Corrections as per PR comments
  • Loading branch information
PlagueHO authored and kwirkykat committed Apr 4, 2018
1 parent 0cc18de commit 8715388
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 110 deletions.
10 changes: 5 additions & 5 deletions DscResource.DocumentationHelper/MofHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ function Get-MofSchemaObject
$currentComment = ""
$currentlyInCommentBlock = $false
$partialLine = $null
foreach($textLine in $contents)
foreach ($textLine in $contents)
{
if ($textLine.StartsWith("/*"))
{
$currentlyInCommentBlock = $true
}
elseif($textLine.StartsWith("*/"))
elseif ($textLine.StartsWith("*/"))
{
$currentlyInCommentBlock = $false
}
elseif($currentlyInCommentBlock -eq $true)
elseif ($currentlyInCommentBlock -eq $true)
{
# Ignore lines in comment blocks
}
Expand Down Expand Up @@ -103,7 +103,7 @@ function Get-MofSchemaObject
}
else
{
if($partialLine)
if ($partialLine)
{
[string] $currentLine = $partialLine + $textLine
$partialLine = $null
Expand All @@ -130,7 +130,7 @@ function Get-MofSchemaObject
$metadataObjects = @()

# Does this assume that the metadata is on the same line?
if($length -gt 0)
if ($length -gt 0)
{
$metadata = $currentLine.Substring($start, $end - $start)
$metadataObjects = $metadata.Split(",")
Expand Down
2 changes: 1 addition & 1 deletion DscResource.Tests.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
CompanyName = 'Microsoft Corporation'

# Copyright statement for this module
Copyright = '(c) 2017 Microsoft Corporation. All rights reserved.'
Copyright = '(c) 2018 Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Module for common meta tests and other shared functions for PowerShell DSC resources repositories.'
Expand Down
Loading

0 comments on commit 8715388

Please sign in to comment.