Skip to content

Commit 8646dd1

Browse files
authored
Feat: code cleanup (#352)
* Feat: code analysis * Feat: cleanup net46 instructs * Feat: cleanup TRAVISCI * Fix: using * Fix: reorder usings * Fix: nuget licence
1 parent b9ee52e commit 8646dd1

40 files changed

+196
-404
lines changed

src/.editorconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ dotnet_naming_style.pascal_case.required_suffix =
144144
dotnet_naming_style.pascal_case.word_separator =
145145
dotnet_naming_style.pascal_case.capitalization = pascal_case
146146

147-
dotnet_naming_style.pascal_case.required_prefix =
148-
dotnet_naming_style.pascal_case.required_suffix =
149-
dotnet_naming_style.pascal_case.word_separator =
150-
dotnet_naming_style.pascal_case.capitalization = pascal_case
151-
152147
# SA1208: System using directives should be placed before other using directives
153148
dotnet_diagnostic.SA1208.severity = error
154149

@@ -253,8 +248,3 @@ dotnet_naming_style.casse_pascal.required_prefix =
253248
dotnet_naming_style.casse_pascal.required_suffix =
254249
dotnet_naming_style.casse_pascal.word_separator =
255250
dotnet_naming_style.casse_pascal.capitalization = pascal_case
256-
257-
dotnet_naming_style.casse_pascal.required_prefix =
258-
dotnet_naming_style.casse_pascal.required_suffix =
259-
dotnet_naming_style.casse_pascal.word_separator =
260-
dotnet_naming_style.casse_pascal.capitalization = pascal_case

src/ConsoleApplication/ConsoleApplication.csproj

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,21 @@
88
<Version>3.1.0</Version>
99
<RootNamespace>System.Net</RootNamespace>
1010
<LangVersion>latestmajor</LangVersion>
11-
11+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1212
</PropertyGroup>
1313

1414
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
1515
<NoWarn />
16+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1617
</PropertyGroup>
1718

1819
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
1920
<NoWarn />
21+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2022
</PropertyGroup>
21-
22-
<ItemGroup>
23-
<None Remove="stylecop.json" />
24-
</ItemGroup>
25-
26-
<ItemGroup>
27-
<AdditionalFiles Include="stylecop.json" />
28-
</ItemGroup>
29-
23+
3024
<ItemGroup>
3125
<PackageReference Include="GnuGetOpt" Version="0.9.2.6" />
32-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
33-
<PrivateAssets>all</PrivateAssets>
34-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
35-
</PackageReference>
3626
</ItemGroup>
3727

3828
<ItemGroup>

src/ConsoleApplication/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
namespace System.Net;
66

7-
using Collections.Generic;
8-
using Diagnostics;
9-
using IO;
10-
using Numerics;
11-
using Reflection;
127
using Gnu.Getopt;
8+
using System.Collections.Generic;
9+
using System.Diagnostics;
10+
using System.IO;
11+
using System.Numerics;
12+
using System.Reflection;
1313

1414
/// <summary>
1515
/// Console app for IPNetwork.

src/ConsoleApplication/stylecop.json

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

src/System.Net.IPNetwork/BigIntegerExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace System.Net;
66

77
using System;
8-
using Numerics;
9-
using Text;
8+
using System.Numerics;
9+
using System.Text;
1010

1111
/// <summary>
1212
/// Extension methods to convert <see cref="System.Numerics.BigInteger"/>

src/System.Net.IPNetwork/CidrClassFull.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace System.Net;
66

7-
using Sockets;
7+
using System.Net.Sockets;
88

99
/// <summary>
1010
/// Class <c>CidrClassFull</c> tries to guess CIDR in a ClassFull way.

src/System.Net.IPNetwork/CidrClassLess.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace System.Net;
66

7-
using Sockets;
7+
using System.Net.Sockets;
88

99
/// <summary>
1010
/// Try to guess a CIDR in a ClassLess way ie. ipv4 = 32, ipv6 = 128.

src/System.Net.IPNetwork/IPAddressCollection.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace System.Net;
66

7-
using Collections;
8-
using Collections.Generic;
9-
using Numerics;
7+
using System.Collections;
8+
using System.Collections.Generic;
9+
using System.Numerics;
1010

1111
/// <summary>
1212
/// Represents different filters for a collection of items.
@@ -45,8 +45,6 @@ internal IPAddressCollection(IPNetwork2 ipnetwork, FilterEnum filter)
4545
this.Reset();
4646
}
4747

48-
#region Count, Array, Enumerator
49-
5048
/// <summary>
5149
/// Gets the count of IP addresses within the network.
5250
/// </summary>
@@ -100,10 +98,6 @@ public IPAddress this[BigInteger i]
10098
}
10199
}
102100

103-
#endregion
104-
105-
#region Legacy Enumeration
106-
107101
/// <summary>
108102
/// Gets the current <see cref="IPAddress"/> from the collection.
109103
/// </summary>
@@ -149,10 +143,6 @@ public void Dispose()
149143
// nothing to dispose
150144
}
151145

152-
#endregion
153-
154-
#region Enumeration
155-
156146
/// <inheritdoc/>
157147
IEnumerator<IPAddress> IEnumerable<IPAddress>.GetEnumerator()
158148
{
@@ -213,6 +203,4 @@ public Enumerator(IPAddressCollection collection)
213203
this.enumerator = -1;
214204
}
215205
}
216-
217-
#endregion
218206
}

src/System.Net.IPNetwork/IPNetwork2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace System.Net;
66

7-
using Runtime.Serialization;
7+
using System.Runtime.Serialization;
88

99
/// <summary>
1010
/// IP Network utility class.

src/System.Net.IPNetwork/IPNetwork2BitsSet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace System.Net;
66

7-
using Sockets;
8-
using Numerics;
7+
using System.Net.Sockets;
8+
using System.Numerics;
99

1010
/// <summary>
1111
/// BitSet.

0 commit comments

Comments
 (0)