Skip to content
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

Change help structure in dotnet test #47288

Merged

Conversation

mariam-abdulla
Copy link
Member

@mariam-abdulla mariam-abdulla commented Mar 5, 2025

This pull request includes several updates to the dotnet-test command's help system to improve the organization and presentation of help options. The changes focus on refactoring methods for better clarity and functionality.

Refactoring and improvements to help system:

These changes enhance the user experience by providing a more organized and comprehensive help output.

image

Relates to #45927

@Copilot Copilot bot review requested due to automatic review settings March 5, 2025 13:43
@mariam-abdulla mariam-abdulla requested a review from a team as a code owner March 5, 2025 13:43
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-dotnet test untriaged Request triage from a team member labels Mar 5, 2025

Choose a reason for hiding this comment

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

PR Overview

This PR refactors the help structure in the dotnet test command by splitting the help output into platform and extension options and updating the related reporting in the terminal.

  • Split the original custom help into two methods: one for the overall help options and one dedicated to platform and extension options.
  • Removed the old WriteCustomHelp method and its related helpers, integrating similar functionality into the new structure.
  • Updated the TerminalTestReporter to use a new WriteOtherOptionsSection method that aligns with the new help layout.

Reviewed Changes

File Description
src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.Help.cs Refactored help commands to separate built-in (platform) and extension options, integrating missing options display.
src/Cli/dotnet/commands/dotnet-test/Terminal/TerminalTestReporter.cs Updated header and added a new WriteOtherOptionsSection method for displaying options help in the terminal.

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

Comments suppressed due to low confidence (2)

src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.Help.cs:97

  • The call to builtInOptions.Any() assumes builtInOptions is not null. Consider adding a null-check or defaulting to an empty list to avoid potential NullReferenceExceptions.
if (builtInOptions.Any())

src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.Help.cs:103

  • The call to nonBuiltInOptions.Any() assumes nonBuiltInOptions is not null. Ensure a null-check or use a default empty list to prevent possible runtime errors.
if (nonBuiltInOptions.Any())
@mariam-abdulla mariam-abdulla enabled auto-merge (squash) March 6, 2025 14:50
@mariam-abdulla mariam-abdulla removed the untriaged Request triage from a team member label Mar 6, 2025
@mariam-abdulla mariam-abdulla merged commit 1262f97 into main Mar 6, 2025
40 checks passed
@mariam-abdulla mariam-abdulla deleted the dev/mabdullah/change-help-option-structure-in-dotnet-test branch March 6, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants