Skip to content

Commit 40258d3

Browse files
BertkEmosewaMClg2de0xceddaveMueller
authored
use System.CommandLine for coverlet.console (#1486)
* use System.CommandLine for coverlet.console * resolve review comments and add DotnetTool tests * add space between CLI argument (#1499) matches the same argument further down * Fix resolving assemblies from frameworks not referenced by coverlet itself (#1449) * Make tests run on all platforms (#1492) * Integration test for assembly resolver for mvc.razor (#1502) * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * remove spelling configuration * use System.CommandLine for coverlet.console * resolve review comments and add DotnetTool tests * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * Update src/coverlet.console/Program.cs Co-authored-by: David Müller <[email protected]> * remove spelling configuration --------- Co-authored-by: David Markowitz <[email protected]> Co-authored-by: Lukas Grützmacher <[email protected]> Co-authored-by: Cédric Luthi <[email protected]> Co-authored-by: David Müller <[email protected]>
1 parent 5bc18ec commit 40258d3

File tree

17 files changed

+385
-241
lines changed

17 files changed

+385
-241
lines changed

.editorconfig

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ end_of_line = crlf
4242

4343
# Code files
4444
[*.{cs,csx,vb,vbx}]
45-
indent_size = 4
45+
indent_size = 2
4646
insert_final_newline = true
4747
charset = utf-8-bom
4848
###############################
@@ -132,12 +132,15 @@ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
132132
dotnet_diagnostic.IDE1006.severity = warning
133133
# IDE0090: Use 'new(...)'
134134
dotnet_diagnostic.IDE0090.severity = warning
135+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
136+
tab_width = 2
137+
end_of_line = crlf
135138
###############################
136139
# C# Coding Conventions #
137140
###############################
138141
[*.cs]
139142
# Organize usings
140-
csharp_using_directive_placement = outside_namespace:warning
143+
csharp_using_directive_placement = outside_namespace:silent
141144
# var preferences - use keywords instead of BCL types, and permit var only when the type is clear
142145
csharp_style_var_for_built_in_types = false:warning
143146
csharp_style_var_when_type_is_apparent = true:warning
@@ -213,3 +216,10 @@ csharp_space_between_square_brackets = false
213216
# Wrapping preferences
214217
csharp_preserve_single_line_statements = true
215218
csharp_preserve_single_line_blocks = true
219+
csharp_prefer_simple_using_statement = true:suggestion
220+
csharp_style_namespace_declarations = block_scoped:silent
221+
csharp_style_prefer_method_group_conversion = true:silent
222+
csharp_style_prefer_top_level_statements = true:silent
223+
csharp_style_prefer_primary_constructors = true:suggestion
224+
csharp_style_expression_bodied_lambdas = true:silent
225+
csharp_style_expression_bodied_local_functions = false:silent

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<AnalysisLevel>preview</AnalysisLevel>
1414
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1515
<LangVersion>preview</LangVersion>
16-
<NoWarn>$(NoWarn);NU5105</NoWarn>
16+
<NoWarn>$(NoWarn);NU5105;CS1591</NoWarn>
1717
<RestoreSources>
1818
https://api.nuget.org/v3/index.json;
1919
</RestoreSources>
@@ -25,7 +25,7 @@
2525
</PropertyGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" />
29-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
28+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" />
29+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
3030
</ItemGroup>
3131
</Project>

Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Project>
22
<ItemGroup>
3-
<PackageReference Update="McMaster.Extensions.CommandLineUtils" Version="2.3.4" />
43
<PackageReference Update="Microsoft.Build.Utilities.Core" Version="15.5.180"/>
54
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" />
65
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
@@ -25,6 +24,7 @@
2524
<PackageReference Update="xunit.assert" Version="2.4.2" />
2625
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1"/>
2726
<PackageReference Update="Tmds.ExecFunction" Version="0.4.0" />
27+
<PackageReference Update="System.CommandLine" Version="2.0.0-beta4.22272.1" />
2828
</ItemGroup>
2929

3030
<!-- Deterministic build workaround -->

Documentation/GlobalTool.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ Arguments:
1717
<ASSEMBLY|DIRECTORY> Path to the test assembly or application directory.
1818

1919
Options:
20-
-h|--help Show help information
21-
-v|--version Show version information
22-
-t|--target Path to the test runner application.
20+
-t|--target (REQUIRED) Path to the test runner application.
2321
-a|--targetargs Arguments to be passed to the test runner.
2422
-o|--output Output of the generated coverage report
2523
-v|--verbosity Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed.
26-
-f|--format Format of the generated coverage report.
24+
-f|--format Format of the generated coverage report. [default: json]
2725
--threshold Exits with error if the coverage % is below value.
2826
--threshold-type Coverage type to apply the threshold to.
29-
--threshold-stat Coverage statistic used to enforce the threshold value.
27+
--threshold-stat Coverage statistic used to enforce the threshold value. [default: Minimum]
3028
--exclude Filter expressions to exclude specific modules and types.
3129
--include Filter expressions to include only specific modules and types.
3230
--exclude-by-file Glob patterns specifying source files to exclude.
@@ -39,6 +37,8 @@ Options:
3937
--use-source-link Specifies whether to use SourceLink URIs in place of file system paths.
4038
--does-not-return-attribute Attributes that mark methods that do not return.
4139
--exclude-assemblies-without-sources Specifies behaviour of heuristic to ignore assemblies with missing source documents.
40+
--version Show version information
41+
-?, -h, --help Show help and usage information
4242
```
4343
4444
NB. For a [multiple value] options you have to specify values multiple times i.e.

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.408",
3+
"version": "6.0.410",
44
"rollForward": "latestMajor"
55
}
66
}

src/coverlet.collector/DataCollection/CoverageWrapper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ internal class CoverageWrapper : ICoverageWrapper
1717
/// </summary>
1818
/// <param name="settings">Coverlet settings</param>
1919
/// <param name="coverletLogger">Coverlet logger</param>
20+
/// <param name="instrumentationHelper"></param>
21+
/// <param name="fileSystem"></param>
22+
/// <param name="sourceRootTranslator"></param>
23+
/// <param name="cecilSymbolHelper"></param>
2024
/// <returns>Coverage object</returns>
2125
public Coverage CreateCoverage(CoverletSettings settings, ILogger coverletLogger, IInstrumentationHelper instrumentationHelper, IFileSystem fileSystem, ISourceRootTranslator sourceRootTranslator, ICecilSymbolHelper cecilSymbolHelper)
2226
{

src/coverlet.collector/coverlet.collector.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<AssemblyTitle>coverlet.collector</AssemblyTitle>

0 commit comments

Comments
 (0)