Skip to content

use latest System.CommandLine version (GA?) #1660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

Bertk
Copy link
Collaborator

@Bertk Bertk commented May 27, 2024

Update coverlet.console for latest version of System.CommandLine API.

Note

New version 2.0.0-beta5.25277.114 of System.CommandLine nuget package was available on nuget.org for 1 day and now it is hidden.

>coverlet.console.exe --help
Description:
  Cross platform .NET Core code coverage tool

Usage:
  coverlet.console <path> [options]

Arguments:
  <path>  Path to the test assembly or application directory.

Options:
  -?, -h, --help                                                     Show help and usage information
  --version                                                          Show version information
  -t, --target (REQUIRED)                                            Path to the test runner application.
  -a, --targetargs                                                   Arguments to be passed to the test runner.
  -o, --output                                                       Output of the generated coverage report
  -v, --verbosity <Detailed|Minimal|Normal|Quiet>                    Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed. [default: Normal]
  -f, --format <cobertura|json|lcov|opencover|teamcity>              Format of the generated coverage report. [default: json]
  --threshold                                                        Exits with error if the coverage % is below value.
  --threshold-type <branch|line|method>                              Coverage type to apply the threshold to. [default: line|branch|method]
  --threshold-stat <Average|Minimum|Total>                           Coverage statistic used to enforce the threshold value. [default: Minimum]
  --exclude                                                          Filter expressions to exclude specific modules and types.
  --include                                                          Filter expressions to include only specific modules and types.
  --exclude-by-file                                                  Glob patterns specifying source files to exclude.
  --include-directory                                                Include directories containing additional assemblies to be instrumented.
  --exclude-by-attribute                                             Attributes to exclude from code coverage.
  --include-test-assembly                                            Specifies whether to report code coverage of the test assembly.
  --single-hit                                                       Specifies whether to limit code coverage hit reporting to a single hit for each location
  --skipautoprops                                                    Neither track nor record auto-implemented properties.
  --merge-with                                                       Path to existing coverage result to merge.
  --use-source-link                                                  Specifies whether to use SourceLink URIs in place of file system paths.
  --does-not-return-attribute                                        Attributes that mark methods that do not return
  --exclude-assemblies-without-sources <MissingAll|MissingAny|None>  Specifies behavior of heuristic to ignore assemblies with missing source documents. [default: MissingAll]
  --source-mapping-file                                              Specifies the path to a SourceRootsMappings file.
  -?, -h, --help                                                     Show help and usage information
  --version                                                          Show version information

@Bertk Bertk changed the title use latest System.CommandLine (GA version?) use latest System.CommandLine version (GA?) May 28, 2024
@Bertk Bertk force-pushed the commandline-ga branch from 598a646 to 5c2a245 Compare May 28, 2024 07:30
@Bertk Bertk force-pushed the commandline-ga branch 2 times, most recently from 9a4226e to df2b821 Compare November 6, 2024 09:28
@Bertk Bertk marked this pull request as ready for review April 1, 2025 10:22
@Bertk Bertk marked this pull request as draft April 13, 2025 08:40
@Bertk Bertk requested a review from Copilot June 6, 2025 07:04
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates Coverlet’s integration with the latest System.CommandLine release alongside various dependency and build configuration updates. Key changes include:

  • Test modifications to update expected coverage output from 100% to 50%.
  • Updates to project files (SDK versions, package references, build configurations) and CI pipeline definitions.
  • Adoption of newer API patterns from System.CommandLine and C# 12 syntax improvements.

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/coverlet.integration.tests/Msbuild.cs Updates expected coverage output in multiple tests.
test/coverlet.integration.tests/DotnetTool.cs Adds exit code validation and logs standard error; review assertion on empty string.
test/coverlet.integration.tests/DeterministicBuild.cs Uses new C# 12 object instantiation syntax.
test/coverlet.integration.tests/Collectors.cs Replaces separate exit code variable with direct assertions.
test/coverlet.integration.template/DeepThought.cs Adds an intentionally untested method for coverage demonstration.
src/coverlet.msbuild.tasks/*.csproj Removes deprecated PackageIconUrl while retaining the project icon.
src/coverlet.core/coverlet.core.csproj Adopts new warning suppression and adds a reference to an unsafe package.
src/coverlet.console/Program.cs Migrates to async Main, adopts new System.CommandLine patterns, and uses a global exit code.
nuget.config, global.json, eng/*.yml, etc. Updates SDK and package versions plus CI pipeline authentication and restore steps.

@Bertk Bertk marked this pull request as ready for review June 7, 2025 07:55
@Bertk Bertk marked this pull request as draft June 7, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant