Skip to content

Commit

Permalink
Update dependencies (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite authored May 25, 2019
1 parent 0ce752c commit dd34fdd
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 43 deletions.
6 changes: 1 addition & 5 deletions PSRule.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ param (
[String]$ArtifactPath = (Join-Path -Path $PWD -ChildPath out/modules)
)

if ($Env:Coverage -eq 'true') {
if ($Env:COVERAGE -eq 'true') {
$CodeCoverage = $True;
}

Expand Down Expand Up @@ -96,9 +96,7 @@ task BuildHelp BuildModule, PlatyPS, {
}

task ScaffoldHelp Build, {

Import-Module (Join-Path -Path $PWD -ChildPath out/modules/PSRule) -Force;

Update-MarkdownHelp -Path '.\docs\commands\PSRule\en-US';
}

Expand Down Expand Up @@ -147,7 +145,6 @@ task VersionModule {
}

task ReleaseModule VersionModule, {

if (![String]::IsNullOrEmpty($NuGetApiKey)) {
# Publish to PowerShell Gallery
Publish-Module -Path (Join-Path -Path $ArtifactPath -ChildPath PSRule) -NuGetApiKey $NuGetApiKey;
Expand Down Expand Up @@ -186,7 +183,6 @@ task PSScriptAnalyzer {
}

task TestModule TestDotNet, Pester, PSScriptAnalyzer, {

# Run Pester tests
$pesterParams = @{ Path = $PWD; OutputFile = 'reports/pester-unit.xml'; OutputFormat = 'NUnitXml'; PesterOption = @{ IncludeVSCodeMarker = $True }; PassThru = $True; };

Expand Down
6 changes: 3 additions & 3 deletions src/PSRule.Benchmark/PSRule.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.11.4" />
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
</ItemGroup>

<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.11.4" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.11.5" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="Microsoft.PowerShell.5.1.ReferenceAssemblies" Version="1.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.1.1" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
17 changes: 11 additions & 6 deletions src/PSRule.Benchmark/PSRule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes;
using PSRule.Pipeline;
using PSRule.Rules;
using System;
Expand Down Expand Up @@ -55,7 +55,7 @@ private void PrepareGetPipeline()
var option = new PSRuleOption();
option.Baseline.RuleName = new string[] { "Benchmark" };
var builder = PipelineBuilder.Get().Configure(option);
builder.Source(new RuleSource[] { new RuleSource(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Benchmark.Rule.ps1"), null) });
builder.Source(new RuleSource[] { new RuleSource(path: GetSource(), moduleName: null) });
_GetPipeline = builder.Build();
}

Expand All @@ -64,7 +64,7 @@ private void PrepareInvokePipeline()
var option = new PSRuleOption();
option.Baseline.RuleName = new string[] { "Benchmark" };
var builder = PipelineBuilder.Invoke().Configure(option);
builder.Source(new RuleSource[] { new RuleSource(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Benchmark.Rule.ps1"), null) });
builder.Source(new RuleSource[] { new RuleSource(path: GetSource(), moduleName: null) });
_InvokePipeline = builder.Build();
}

Expand All @@ -73,7 +73,7 @@ private void PrepareInvokeIfPipeline()
var option = new PSRuleOption();
option.Baseline.RuleName = new string[] { "BenchmarkIf" };
var builder = PipelineBuilder.Invoke().Configure(option);
builder.Source(new RuleSource[] { new RuleSource(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Benchmark.Rule.ps1"), null) });
builder.Source(new RuleSource[] { new RuleSource(path: GetSource(), moduleName: null) });
_InvokeIfPipeline = builder.Build();
}

Expand All @@ -82,7 +82,7 @@ private void PrepareInvokeTypePipeline()
var option = new PSRuleOption();
option.Baseline.RuleName = new string[] { "BenchmarkType" };
var builder = PipelineBuilder.Invoke().Configure(option);
builder.Source(new RuleSource[] { new RuleSource(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Benchmark.Rule.ps1"), null) });
builder.Source(new RuleSource[] { new RuleSource(path: GetSource(), moduleName: null) });
_InvokeTypePipeline = builder.Build();
}

Expand All @@ -92,10 +92,15 @@ private void PrepareInvokeSummaryPipeline()
option.Baseline.RuleName = new string[] { "Benchmark" };
option.Output.As = ResultFormat.Summary;
var builder = PipelineBuilder.Invoke().Configure(option);
builder.Source(new RuleSource[] { new RuleSource(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Benchmark.Rule.ps1"), null) });
builder.Source(new RuleSource[] { new RuleSource(path: GetSource(), moduleName: null) });
_InvokeSummaryPipeline = builder.Build();
}

private string GetSource()
{
return Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Benchmark.Rule.ps1");
}

private void PrepareTargetObjects()
{
var r = new Random();
Expand Down
2 changes: 1 addition & 1 deletion src/PSRule.Benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static void RunProfile(CommandLineApplication app)
}

// Do benchmarks
var summary = BenchmarkRunner.Run<PSRule>(config);
BenchmarkRunner.Run<PSRule>(config);

return 0;
});
Expand Down
2 changes: 1 addition & 1 deletion src/PSRule/Annotations/BlockMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
/// </summary>
public sealed class BlockMetadata
{
public string Description { get; set; }
public string Description;
}
}
1 change: 0 additions & 1 deletion src/PSRule/Pipeline/NUnit3Serializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PSRule.Rules;

namespace PSRule.Pipeline
{
Expand Down
2 changes: 1 addition & 1 deletion src/PSRule/Pipeline/PipelineReciever.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static IEnumerable<PSObject> ConvertFromYaml(PSObject sourceObject, Visit
}
}

var parser = new Parser(reader);
var parser = new YamlDotNet.Core.Parser(reader);

parser.Expect<StreamStart>();

Expand Down
21 changes: 8 additions & 13 deletions src/PSRule/Pipeline/PowerShellPipelineStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,21 @@ private void WriteObject(object o, bool expandCollection)

private void WriteObjectJson(IEnumerable<RuleRecord> o)
{
var settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
var settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
};
var json = JsonConvert.SerializeObject(o, settings: settings);

_OutputVisitor(json, false);
}

private void WriteObjectJson(IEnumerable<RuleSummaryRecord> o)
{
var settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
var settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
};
var json = JsonConvert.SerializeObject(o, settings: settings);

_OutputVisitor(json, false);
Expand Down Expand Up @@ -173,21 +177,12 @@ private void WriteObjectYaml(IEnumerable<RuleSummaryRecord> o)

private void WriteObjectNUnit3(IEnumerable<InvokeResult> o)
{
var sb = new StringBuilder();
var s = new NUnit3Serializer();
var xml = s.Serialize(o);

_OutputVisitor(xml, false);
}

private void WriteObjectNUnit(IEnumerable<RuleSummaryRecord> o)
{
var sb = new StringBuilder();
var xml = sb.ToString();

_OutputVisitor(xml, false);
}

private RuleRecord[] GetRecords()
{
var results = _Results.SelectMany(r => r.AsRecord()).ToArray();
Expand Down
10 changes: 2 additions & 8 deletions src/PSRule/Rules/TagSet.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Dynamic;
Expand All @@ -22,13 +22,7 @@ private TagSet(Dictionary<string, string> tag)
_Tag = tag;
}

public int Count
{
get
{
return _Tag.Count;
}
}
public int Count => _Tag.Count;

public bool Contains(object key, object value)
{
Expand Down
8 changes: 4 additions & 4 deletions tests/PSRule.Tests/PSRule.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
Expand All @@ -9,9 +9,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeCoverage" Version="16.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.1.1" />
<PackageReference Include="Microsoft.CodeCoverage" Version="16.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.0" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="6.2.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit dd34fdd

Please sign in to comment.