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

Add --format to dotnet sln list #39801

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jdraaijer-microsoft
Copy link

@jdraaijer-microsoft jdraaijer-microsoft commented Mar 27, 2024

Add a --format option to dotnet sln list.

Closes #26303

Unresolved questions:

  • What should I do with the untranslated translation entries?
  • Is there a specific policy that says "don't have options with underscores", and if so, what should I replace console_with_header with, or are there better names for this?
  • Is there a good way to indicate that console_with_header is the default value?
  • Add tests that validate the output

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-CLI untriaged Request triage from a team member labels Mar 27, 2024
Copy link
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

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

Left a single design note, but I'm very excited to see this! Thank you for taking the time to contribute this work.

console_with_header} and replace with SlnListReportOutputFormat.text

namespace Microsoft.DotNet.Tools.Sln.List
{
internal class ListProjectsInSolutionCommand : CommandBase
{
private readonly static JsonSerializerOptions s_noEscapeJsonSerializerOptions = new() { Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping };
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, why use this encoder specifically?

Copy link
Author

Choose a reason for hiding this comment

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

I got confused and thought that this was what dotnet list package used, but seems I ended up using what dotnet tool list uses. I

s there a different one that is more common/would not pique your curiosity? :P

Copy link
Member

Choose a reason for hiding this comment

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

I don't actually know what they use (the implementation is over in NuGet.Client repo I suppose, I could go look), but if you aligned with there decision I'm 100% ok with using that!

@baronfel
Copy link
Member

What should I do with the untranslated translation entries?

Don't worry about these - there's an out-of-band process that ships the untranslated entries to our localization team, they make adjustments, and then they send those changes back to us in a PR.

@baronfel baronfel requested a review from a team March 27, 2024 16:24
Copy link
Member

@MiYanni MiYanni left a comment

Choose a reason for hiding this comment

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

A test should be added for this. Likely, one that runs the command with --format and then compares the output to see if it is correct.

Comment on lines +8 to +9
text = 0,
json = 1,
Copy link
Member

Choose a reason for hiding this comment

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

Enum members should be PascalCase, so Text and Json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CLI untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement bare output for dotnet sln list
3 participants