dotnet / command-line-api

Command line parsing, invocation, and rendering of terminal output.
https://github.com/dotnet/command-line-api/wiki
MIT License
3.38k stars 381 forks source link

Git guidelines and Powderhouse #2341

Open KathleenDollard opened 7 months ago

KathleenDollard commented 7 months ago

We picked the code name Powderhouse because it is a cool place and we thought it hints at what we are doing. The Powderhouse at Powderhouse Square was actually built as a windmill and is a tall, well built stone bulding whose use has evolved over the years. We're evolving System.CommandLine - although a bit inverse of The Powderhouse evolution. We are keeping the purpose and changing the shape.

Powder is black powder, which is a low explosive used in pyrotechnics and other uses such as building roads. We have decided to blow things up a bit. System.CommandLine is a solid and we love it. As covered in #2338 we need to make changes to get the parser ready for incorporation in the .NET libraries and to make features/subsystems easy to extend.

When you are playing with pyrotechnics, you need guardrails. Here, git is an important set of guardrails, allowing us to see history. Maintaining git history means avoiding large red blocks in PRs and tending to small well described commits. We will ask for updates on PRs that don't support our commitment to tracking.

A distinct clean up effort that we will do late in this restructuring effort will be described in a separate issue, so you can check that your annoyances will be fixed prior to GA.

One thing you may notice in the code is that we have removed globbing in the projects that have old code. This lets us temporarily remove code without touching the file.

All code

/* Remove this code as unnecessary (we need extra coffee on all days)
if (itsMonday) BrewExtraCoffee();
*/

// TODO: Consider removing this code. Don't we need extra coffee on all days?
/* 
if (itsMonday) BrewExtraCoffee();
*/

Note that the stylistic change of putting conditional comments in braces on new lines is not made.

Special considerations for testing

We want to be able to track all tests. Some will be deleted because they are no longer relevant - for example, our current plan is to have version be an explicitly added feature, so tests that it is implicitly added are no longer correct. However, we want to track the test and plan an explicit pass on tests. Leaving them in place commented out leaves a location for the reason they have been commented out.

// Powderhouse: _Explanation of change_

// Powderhouse: Changed test since then now need to explicitly add the response file handler
mhutch commented 7 months ago

Do not adjust formatting. In particular, do not convert to file scoped namespaces.

However, please use file scoped namespaces in new files that do not contain code copied from existing files.

KathleenDollard commented 7 months ago

Do not adjust formatting. In particular, do not convert to file scoped namespaces.

However, please use file scoped namespaces in new files that do not contain code copied from existing files.

I updated the guideline to reflect your suggestion

EugeneKrapivin commented 6 months ago

Do you have any plans to integrate into the Generic host pattern, i.e. be part of the generic host, and now wrap it into a middleware in the invocation path?

KathleenDollard commented 6 months ago

@EugeneKrapivin We definitely think that is important. It will not be part of the first phase. That phase will rebuild the functionality of the System.CommandLine project only.