Skip to content

Commit cd2ac39

Browse files
rheoneahsteele
authored andcommitted
Fix nuget embedded icon issue, cleanup warnings
* Fixing misc project issues: - fixing creeping build warnings and formatted DocExamples that were crafted w/o help of resharper ruleset availability - tweaking project style settings; by no means done - now ignoring CA1710 & CA1303 - moved & renamed nupkg embedded icon * trying to clean up resharper / editor / warning settings for project - dumped existing resharper settings - adding to dictionary - managing coding conventions - tweaking ruleset Issue: #24
1 parent 3913726 commit cd2ac39

16 files changed

+1527
-1129
lines changed

src/.editorconfig

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
root = true
2+
3+
# All files
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_size = 4
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
# json
13+
[*.json]
14+
indent_size = 2
15+
tab_width=2
16+
17+
# YAML Files
18+
[*.{yml,yaml}]
19+
indent_size = 2
20+
21+
# Bash Files
22+
[*.sh]
23+
end_of_line = lf
24+
25+
# Batch Files
26+
[*.{cmd,bat,ps1}]
27+
end_of_line = crlf
28+
29+
# Visual Studio Solutions
30+
[*.sln]
31+
indent_style = tab
32+
33+
# Visual Studio Project Files
34+
[*.csproj]
35+
indent_size = 2
36+
37+
# XML
38+
[*.xml}]
39+
indent_size=2
40+
tab_width=2

src/Arcus.DocExamples/.editorconfig

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/Arcus.DocExamples/AbstractIPAddressRangeExamples.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Net;
1+
using System.Globalization;
2+
using System.Net;
23
using Xunit;
34

45
namespace Arcus.DocExamples
@@ -17,7 +18,7 @@ public void IFormattable_Example()
1718
const string expected = "192.168.0.0 - 192.168.128.0";
1819

1920
// Act
20-
var formattableString = string.Format("{0:g}", ipAddressRange);
21+
var formattableString = string.Format(CultureInfo.InvariantCulture, "{0:g}", ipAddressRange);
2122

2223
// Assert
2324
Assert.Equal(expected, formattableString);

src/Arcus.DocExamples/Arcus.DocExamples.csproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
55
<IsPackable>false</IsPackable>
6+
<LangVersion>latest</LangVersion>
7+
<Copyright>Copyright 2018 National Technology &amp; Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.</Copyright>
8+
<Description>Document exampl package for Arcus</Description>
9+
<Authors>Sandia National Laboratories</Authors>
10+
<Company>Sandia National Laboratories</Company>
611
</PropertyGroup>
712

813
<ItemGroup>
914
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
10-
<PackageReference Include="Moq" Version="4.13.0" />
1115
<PackageReference Include="xunit" Version="2.4.1" />
1216
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
1317
<PrivateAssets>all</PrivateAssets>
@@ -21,7 +25,7 @@
2125
</ItemGroup>
2226

2327
<PropertyGroup>
24-
<CodeAnalysisRuleSet>..\analyzers.ruleset</CodeAnalysisRuleSet>
28+
<CodeAnalysisRuleSet>..\analyzers.tests.ruleset</CodeAnalysisRuleSet>
2529
</PropertyGroup>
2630

2731
<ItemGroup>
@@ -44,10 +48,10 @@
4448
<PrivateAssets>all</PrivateAssets>
4549
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4650
</PackageReference>
47-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
51+
<!--<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
4852
<PrivateAssets>all</PrivateAssets>
4953
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
50-
</PackageReference>
54+
</PackageReference>-->
5155
</ItemGroup>
5256

5357

Lines changed: 82 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,101 @@
1-
using System.Linq;
2-
using System.Net;
3-
using System.Text;
4-
using Arcus.Converters;
1+
using System.Text;
2+
using Arcus.Utilities;
53
using Gulliver;
64
using Xunit;
75
using Xunit.Abstractions;
86

97
namespace Arcus.DocExamples
108
{
11-
public class DocReferenceGenerator
12-
{
9+
public class DocReferenceGenerator
10+
{
11+
#region Setup / Teardown
1312

14-
private readonly ITestOutputHelper output;
13+
public DocReferenceGenerator(ITestOutputHelper output)
14+
{
15+
this.output = output;
16+
}
1517

16-
public DocReferenceGenerator(ITestOutputHelper output)
17-
{
18-
this.output = output;
19-
}
18+
private readonly ITestOutputHelper output;
2019

21-
[Fact]
22-
public void IPv4CirdRefGen()
23-
{
24-
var sb = new StringBuilder();
20+
#endregion
2521

26-
sb.Append("CIDR").Append(',')
27-
.Append("Network Prefix Address").Append(',')
28-
.Append("Route Prefix").Append(',')
29-
.Append("Netmask").Append(',')
30-
.Append("Netmask (bits)").Append(',')
31-
.Append("Address Count").Append(',')
32-
.Append("Address Count 2^n")
33-
.AppendLine();
22+
[Fact]
23+
public void IPv4CirdRefGen()
24+
{
25+
var sb = new StringBuilder();
3426

35-
for (var i = 32; i >= 0; i--)
36-
{
37-
var subnet = new Subnet(Utilities.IPAddressUtilities.IPv4MaxAddress, i);
27+
sb.Append("CIDR")
28+
.Append(',')
29+
.Append("Network Prefix Address")
30+
.Append(',')
31+
.Append("Route Prefix")
32+
.Append(',')
33+
.Append("Netmask")
34+
.Append(',')
35+
.Append("Netmask (bits)")
36+
.Append(',')
37+
.Append("Address Count")
38+
.Append(',')
39+
.Append("Address Count 2^n")
40+
.AppendLine();
3841

39-
sb.Append(subnet).Append(',')
40-
.Append(subnet.NetworkPrefixAddress).Append(',')
41-
.Append(subnet.RoutingPrefix).Append(',')
42-
.Append(subnet.Netmask).Append(',')
43-
.Append(subnet.Netmask.GetAddressBytes().ToString("b")).Append(',')
44-
.Append(subnet.Length).Append(',')
45-
.Append(32 - i)
46-
.AppendLine();
47-
}
42+
for (var i = 32; i >= 0; i--)
43+
{
44+
var subnet = new Subnet(IPAddressUtilities.IPv4MaxAddress, i);
4845

49-
this.output.WriteLine(sb.ToString());
50-
}
46+
sb.Append(subnet)
47+
.Append(',')
48+
.Append(subnet.NetworkPrefixAddress)
49+
.Append(',')
50+
.Append(subnet.RoutingPrefix)
51+
.Append(',')
52+
.Append(subnet.Netmask)
53+
.Append(',')
54+
.Append(subnet.Netmask.GetAddressBytes()
55+
.ToString("b"))
56+
.Append(',')
57+
.Append(subnet.Length)
58+
.Append(',')
59+
.Append(32 - i)
60+
.AppendLine();
61+
}
5162

52-
[Fact]
53-
public void IPv6CirdRefGen()
54-
{
55-
var sb = new StringBuilder();
63+
this.output.WriteLine(sb.ToString());
64+
}
5665

57-
sb.Append("CIDR").Append(',')
58-
.Append("Network Prefix Address").Append(',')
59-
.Append("Route Prefix").Append(',')
60-
.Append("Address Count").Append(',')
61-
.Append("Address Count 2^n")
62-
.AppendLine();
66+
[Fact]
67+
public void IPv6CirdRefGen()
68+
{
69+
var sb = new StringBuilder();
6370

64-
for (var i = 128; i >= 0; i--)
65-
{
66-
var subnet = new Subnet(Utilities.IPAddressUtilities.IPv6MaxAddress, i);
71+
sb.Append("CIDR")
72+
.Append(',')
73+
.Append("Network Prefix Address")
74+
.Append(',')
75+
.Append("Route Prefix")
76+
.Append(',')
77+
.Append("Address Count")
78+
.Append(',')
79+
.Append("Address Count 2^n")
80+
.AppendLine();
6781

68-
sb.Append(subnet).Append(',')
69-
.Append(subnet.NetworkPrefixAddress).Append(',')
70-
.Append(subnet.RoutingPrefix).Append(',')
71-
.Append(subnet.Length).Append(',')
72-
.Append(128 - i)
73-
.AppendLine();
74-
}
82+
for (var i = 128; i >= 0; i--)
83+
{
84+
var subnet = new Subnet(IPAddressUtilities.IPv6MaxAddress, i);
7585

76-
this.output.WriteLine(sb.ToString());
77-
}
78-
}
86+
sb.Append(subnet)
87+
.Append(',')
88+
.Append(subnet.NetworkPrefixAddress)
89+
.Append(',')
90+
.Append(subnet.RoutingPrefix)
91+
.Append(',')
92+
.Append(subnet.Length)
93+
.Append(',')
94+
.Append(128 - i)
95+
.AppendLine();
96+
}
97+
98+
this.output.WriteLine(sb.ToString());
99+
}
100+
}
79101
}

0 commit comments

Comments
 (0)