Skip to content

Commit fbcd2cc

Browse files
committed
Wholesale refactoring and update to .NET 9
* This is in preperation to make this repo fit the intended use and include all the standard support * This is also to aid in updating to the latest docfx tool instead of the legacy and unsupported docfxconsole.
1 parent fecf5bf commit fbcd2cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+610
-427
lines changed

.editorconfig

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#Primary settings apply to all files unless overridden below
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
insert_final_newline = true
8+
9+
# match VS generated formatting for MSBuild project files
10+
[*.*proj,*.props,*.targets]
11+
indent_size = 2
12+
13+
# match ISO standard requirement for C/C++
14+
[*.c,*.h,*.cpp]
15+
insert_final_newline = true
16+
17+
[*.cs]
18+
csharp_style_conditional_delegate_call = true:warning
19+
csharp_style_expression_bodied_accessors = true:suggestion
20+
csharp_style_expression_bodied_indexers = true:suggestion
21+
csharp_style_expression_bodied_methods = true:suggestion
22+
csharp_style_expression_bodied_operators = true:suggestion
23+
csharp_style_expression_bodied_properties = true:warning
24+
csharp_style_inlined_variable_declaration = true:warning
25+
csharp_style_pattern_matching_over_as_with_null_check = true:warning
26+
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
27+
csharp_style_throw_expression = true:warning
28+
csharp_style_var_for_built_in_types = false:error
29+
csharp_style_var_when_type_is_apparent = true:warning
30+
csharp_style_var_elsewhere = false:none
31+
csharp_new_line_before_catch = true
32+
csharp_new_line_before_else = true
33+
csharp_new_line_before_finally = true
34+
csharp_new_line_before_open_brace = all
35+
csharp_new_line_between_query_expression_clauses = true
36+
dotnet_sort_system_directives_first = true
37+
dotnet_style_coalesce_expression = true:warning
38+
dotnet_style_collection_initializer = true:warning
39+
dotnet_style_explicit_tuple_names = true:warning
40+
dotnet_style_null_propagation = true:warning
41+
dotnet_style_qualification_for_event = false:error
42+
dotnet_style_qualification_for_field = false:error
43+
dotnet_style_qualification_for_property = false:error
44+
csharp_indent_block_contents = true
45+
csharp_indent_case_contents = true
46+
csharp_indent_labels = one_less_than_current
47+
csharp_indent_switch_labels = false
48+
csharp_space_after_cast = false
49+
csharp_space_after_colon_in_inheritance_clause = true
50+
csharp_space_after_comma = true
51+
csharp_space_after_keywords_in_control_flow_statements = false
52+
csharp_space_after_semicolon_in_for_statement = true
53+
csharp_space_around_binary_operators = before_and_after
54+
csharp_space_between_method_call_name_and_opening_parenthesis = false
55+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
56+
csharp_space_around_declaration_statements = ignore
57+
csharp_space_between_method_call_parameter_list_parentheses = true
58+
csharp_space_between_square_brackets = true

CommandlineParsing.sln

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27130.2020
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.13.35828.75 d17.13
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubiquity.CommandlineParsing", "Ubiquity.CommandlineParsing\Ubiquity.CommandlineParsing.csproj", "{068EAD73-EE70-4D5F-BFC8-5F13AB1BFE21}"
77
EndProject
@@ -13,28 +13,26 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ubiquity.CommandlineParsing
1313
EndProject
1414
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repo Items", "Repo Items", "{2CC0C61E-2792-4E92-B72E-0DD1F72A7D05}"
1515
ProjectSection(SolutionItems) = preProject
16-
appveyor.yml = appveyor.yml
1716
BuildVersion.xml = BuildVersion.xml
1817
Clone-Docs.ps1 = Clone-Docs.ps1
1918
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
2019
Directory.Build.props = Directory.Build.props
2120
Directory.Build.targets = Directory.Build.targets
21+
global.json = global.json
2222
GOVERNANCE.md = GOVERNANCE.md
2323
LICENSE.md = LICENSE.md
2424
nuget.config = nuget.config
25+
Packages.props = Packages.props
2526
Push-Docs.ps1 = Push-Docs.ps1
27+
readme.md = readme.md
2628
stylecop.json = stylecop.json
29+
Ubiquity.NET.ruleset = Ubiquity.NET.ruleset
2730
EndProjectSection
2831
EndProject
2932
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{D50F6965-5684-404D-A886-CD6E1A7A093E}"
3033
EndProject
3134
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleArgs", "SampleArgs\SampleArgs.csproj", "{694CC71C-BD60-4B94-BC64-391949BA269E}"
3235
EndProject
33-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{83C217F8-0B68-4729-A201-F3D3B9CA784E}"
34-
ProjectSection(SolutionItems) = preProject
35-
readme.md = readme.md
36-
EndProjectSection
37-
EndProject
3836
Global
3937
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4038
Debug|Any CPU = Debug|Any CPU

Directory.Build.props

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
other projects that might want to set the build outputs etc... into a different place.
1515
-->
1616
<PropertyGroup>
17-
<!-- Default to x86/Win32 | Debug build if not otherwise specified -->
17+
<!-- Default to x64/AnyCPU | Release build if not otherwise specified -->
1818
<Platform Condition="'$(Platform)'=='' AND '$(MSBuildProjectExtension)'!='.vcxproj'">AnyCPU</Platform>
19-
<Platform Condition="'$(Platform)'=='' AND '$(MSBuildProjectExtension)'=='.vcxproj'">Win32</Platform>
19+
<Platform Condition="'$(Platform)'=='' AND '$(MSBuildProjectExtension)'=='.vcxproj'">x64</Platform>
2020
<Platform Condition="$(Platform)=='x86' AND '$(MSBuildProjectExtension)'=='.vcxproj'">Win32</Platform>
2121
<UnifiedPlatformPathName Condition="'$(UnifiedPlatformPathName)'==''">$(Platform)</UnifiedPlatformPathName>
2222
<UnifiedPlatformPathName Condition="'$(UnifiedPlatformPathName)'=='Win32'">x86</UnifiedPlatformPathName>
23-
<UnifiedPlatformPathName Condition="'$(UnifiedPlatformPathName)'=='AnyCPU'">x86</UnifiedPlatformPathName>
23+
<UnifiedPlatformPathName Condition="'$(UnifiedPlatformPathName)'=='AnyCPU'">x64</UnifiedPlatformPathName>
2424

25-
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
25+
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
2626

2727
<!-- Use the location of this file (at the top of the build tree) to define the root directory, if not already set -->
2828
<BuildRootDir Condition="'$(BuildRootDir)'==''">$(MSBuildThisFileDirectory)</BuildRootDir>
@@ -39,40 +39,29 @@
3939

4040
<BuildOutputPackagesDir Condition="'$(BuildOutputPackagesDir)'==''">$(BaseBuildOutputPath)packages\</BuildOutputPackagesDir>
4141

42-
<BuildVersionXmlFile Condition="'$(BuildVersionXmlFile)'==''">$(MSBuildThisFileDirectory)BuildVersion.xml</BuildVersionXmlFile>
43-
<IsAutomatedBuild Condition="'$(IsAutomatedBuild)'=='' AND '$(APPVEYOR)'!=''">true</IsAutomatedBuild>
42+
<BuildVersionXml Condition="'$(BuildVersionXmlFile)'==''">$(MSBuildThisFileDirectory)BuildVersion.xml</BuildVersionXml>
43+
<IsAutomatedBuild Condition="'$(IsAutomatedBuild)'=='' AND '$(CI)'!=''">true</IsAutomatedBuild>
4444
<IsAutomatedBuild Condition="'$(IsAutomatedBuild)'==''">false</IsAutomatedBuild>
4545

4646
<IsPullRequestBuild Condition="'$(IsPullRequestBuild)'=='' AND '$(APPVEYOR_PULL_REQUEST_NUMBER)'!=''">true</IsPullRequestBuild>
4747
<IsPullRequestBuild Condition="'$(IsPullRequestBuild)'==''">false</IsPullRequestBuild>
4848

49-
<IsReleaseBuild Condition="'$(IsReleaseBuild)'=='' AND '$(APPVEYOR_REPO_TAG)'=='true' AND '$(APPVEYOR_PULL_REQUEST_NUMBER)'=='' AND '$(APPVEYOR_BRANCH)'=='master'">true</IsReleaseBuild>
49+
<IsReleaseBuild Condition="'$(IsReleaseBuild)'=='' AND '$(APPVEYOR_REPO_TAG)'=='true' AND '$(APPVEYOR_PULL_REQUEST_NUMBER)'==''">true</IsReleaseBuild>
5050
<IsReleaseBuild Condition="'$(IsReleaseBuild)'==''">false</IsReleaseBuild>
51-
<BuildVersionXml>$(MSBuildThisFileDirectory)BuildVersion.xml</BuildVersionXml>
52-
<BuildTimeStamp Condition="'$(BuildTimeStamp)'=='' AND '$(APPVEYOR_REPO_COMMIT_TIMESTAMP)'!=''">$(APPVEYOR_REPO_COMMIT_TIMESTAMP)</BuildTimeStamp>
51+
<BuildTime Condition="'$(BuildTime)'=='' AND '$(APPVEYOR_REPO_COMMIT_TIMESTAMP)'!=''">$(APPVEYOR_REPO_COMMIT_TIMESTAMP)</BuildTime>
52+
<!--<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>-->
5353
</PropertyGroup>
5454
<Choose>
5555
<!-- Apply standard analyzers and rule sets for all C# projects -->
56-
<When Condition="'$(MSBuildProjectExtension)'=='.csproj'">
56+
<When Condition="'$(MSBuildProjectExtension)'=='.csproj' and '$(DisableDirProps)'!='true'">
5757
<PropertyGroup>
5858
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Ubiquity.NET.ruleset</CodeAnalysisRuleSet>
5959
<CodeAnalysisIgnoreGeneratedCode>true</CodeAnalysisIgnoreGeneratedCode>
6060
<Determenistic>true</Determenistic>
6161
<IsTestProject>$(MSBuildProjectName.Contains('UT'))</IsTestProject>
62-
<OutputPath Condition="'$(OutputPath)' == '' and '$(PlatformName)' == 'AnyCPU'">$(BaseOutputPath)$(Configuration)\</OutputPath>
63-
<OutputPath Condition="'$(OutputPath)' == '' and '$(PlatformName)' != 'AnyCPU'">$(BaseOutputPath)$(PlatformName)\$(Configuration)\</OutputPath>
64-
<OutputPath Condition="!HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath>
6562
</PropertyGroup>
66-
<ItemGroup Condition="'$(NoCommonAnalyzers)'!='true' and '$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
67-
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.0" PrivateAssets="All" />
68-
</ItemGroup>
6963
<ItemGroup Condition="'$(NoCommonAnalyzers)'!='true'">
70-
<PackageReference Include="Microsoft.AnalyzerPowerPack" Version="1.1.0" PrivateAssets="All" />
71-
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="All" />
72-
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="All" />
7364
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
74-
</ItemGroup>
75-
<ItemGroup Condition="'$(NoCommonAnalyzers)'!='true'">
7665
<None Include="$(MSBuildThisFileDirectory)Ubiquity.NET.ruleset" Link="Ubiquity.NET.ruleset" />
7766
</ItemGroup>
7867
</When>

GOVERNANCE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ contributions enable the project team to ensure that they are satisfying the nee
8080
activities include (but are not limited to):
8181

8282
* Evangelizing about the project
83-
* Informing developers of project strengths and weaknesses from a new users perspective
84-
* Providing moral support (a thank you goes a long way)
83+
* Informing developers of project strengths and weaknesses from a new user's perspective
84+
* Providing moral support (a 'thank you' goes a long way)
8585
* Providing financial support
8686

8787
Users who continue to engage with the project and its community will often find themselves becoming more and more
@@ -105,6 +105,6 @@ in our [roles in open source document](http://oss-watch.ac.uk/resources/rolesino
105105

106106
### Decision-making process
107107

108-
The benevolent dictatorship model does not need a formal conflict resolution process, since the project leads word is
108+
The benevolent dictatorship model does not need a formal conflict resolution process, since the project lead's word is
109109
final. If the community chooses to question the wisdom of the actions of a committer, the project lead can review their
110110
decisions by checking the communication archives, and either uphold or reverse them.

Packages.props

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<GlobalPackageReference Include="CSemVer.Build.Tasks" Version="2.0.5" />
5+
<GlobalPackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2" Condition="'$(NoCommonAnalyzers)'!='true'" />
6+
<GlobalPackageReference Include="RefactoringEssentials" Version="5.6.0" Condition="'$(NoCommonAnalyzers)'!='true'" />
7+
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.1.118" Condition="'$(NoCommonAnalyzers)'!='true'" />
8+
<GlobalPackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'" />
9+
</ItemGroup>
10+
<ItemGroup>
11+
<PackageReference Update="Ubiquity.ArgValidators" Version="6.0.1" />
12+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.13.0" />
13+
<PackageReference Update="MSTest.TestFramework" Version="3.8.3" />
14+
<PackageReference Update="MSTest.TestAdapter" Version="3.8.3" />
15+
<PackageReference Update="Sprache" Version="2.3.1" />
16+
<PackageReference Update="docfx.console" Version="2.59.4" />
17+
<PackageReference Update="memberpage" Version="2.59.4" />
18+
<PackageReference Update="msdn.4.5.2" Version="0.1.0-alpha-1611021200" />
19+
</ItemGroup>
20+
</Project>

SampleArgs/GlobalSuppressions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#pragma warning disable SA1636 // File header copyright text must match
2+
/* This file is used by Code Analysis to maintain SuppressMessage
3+
// attributes that are applied to this project.
4+
// Project-level suppressions either have no target or are given
5+
// a specific target and scoped to a namespace, type, member, etc.
6+
*/
7+
8+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( "StyleCop.CSharp.DocumentationRules", "SA1652:Enable XML documentation output", Justification = "Sample Code" )]

SampleArgs/Program.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
1+

2+
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
23
// Licensed under the MIT license. See the LICENSE.md file in the project root for full license information.
34

45
using System;
56
using System.Collections.Generic;
67
using System.ComponentModel;
78
using Ubiquity.CommandlineParsing;
89

9-
// warning SA1652: Enable XML documentation output
10-
// This is a sample app and not a documented API
11-
#pragma warning disable SA1652
12-
1310
namespace SampleArgs
1411
{
1512
public static class Program
@@ -30,7 +27,7 @@ public static void Main( string[] args )
3027
Console.WriteLine( "Option1: {0}", options.Option1 );
3128
Console.WriteLine( "Option2: {0}", options.Option2 );
3229
Console.WriteLine( "PositionalArgs:" );
33-
foreach( var positional in options.PositionalArgs )
30+
foreach( string positional in options.PositionalArgs )
3431
{
3532
Console.WriteLine( positional );
3633
}
@@ -45,7 +42,7 @@ public static void Main( string[] args )
4542
[DefaultProperty( "PositionalArgs" )]
4643
internal class Options
4744
{
48-
public List<string> PositionalArgs { get; } = new List<string>( );
45+
public List<string> PositionalArgs { get; } = [];
4946

5047
[CommandlineArg( AllowSpaceDelimitedValue = true )]
5148
public string Option1 { get; set; }

SampleArgs/SampleArgs.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net47;netcoreapp2.0</TargetFrameworks>
5+
<TargetFramework>net9.0</TargetFramework>
66
</PropertyGroup>
77

8+
<!--<PropertyGroup>
9+
<NoWarn>1701;1702;SA0001</NoWarn>
10+
</PropertyGroup>-->
11+
812
<ItemGroup>
913
<ProjectReference Include="..\Ubiquity.CommandlineParsing.Monad\Ubiquity.CommandlineParsing.Monad.csproj" />
1014
</ItemGroup>

Ubiquity.CommandlineParsing.Monad.UT/BinderTests.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
2-
// Licensed under the MIT license. See the LICENSE.md file in the project root for full license information.
1+
// -----------------------------------------------------------------------
2+
// <copyright file="BinderTests.cs" company="Ubiquity.NET Contributors">
3+
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
4+
// </copyright>
5+
// -----------------------------------------------------------------------
36

47
#pragma warning disable SA1649, SA1402, SA1202, SA1652
58

@@ -16,7 +19,7 @@ public enum Option3Values
1619
{
1720
Foo,
1821
Bar,
19-
Baz
22+
Baz,
2023
}
2124

2225
public List<string> PositionalArgs { get; } = new List<string>( );
@@ -56,7 +59,7 @@ public class BinderTests
5659
@"-m:multi3",
5760
@"-o4",
5861
@"positional2",
59-
@"""positional 3\"""
62+
@"""positional 3\""",
6063
};
6164

6265
[TestMethod]
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
2-
// Licensed under the MIT license. See the LICENSE.md file in the project root for full license information.
1+
// -----------------------------------------------------------------------
2+
// <copyright file="GlobalSuppression.cs" company="Ubiquity.NET Contributors">
3+
// Copyright (c) Ubiquity.NET Contributors. All rights reserved.
4+
// </copyright>
5+
// -----------------------------------------------------------------------
36

47
using System.Diagnostics.CodeAnalysis;
58

69
[assembly: SuppressMessage( "StyleCop.CSharp.DocumentationRules", "SA1652:Enable XML documentation output", Justification = "Unit Tests" )]
10+
[assembly: SuppressMessage( "StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "Unit Tests" )]

0 commit comments

Comments
 (0)