Open mikadumont opened 3 years ago
Can you share a bit more details what are you expecting here? Do you expect dotnet new editorconfig
like https://github.com/dotnet/templating/issues/3195 suggests or you expect dotnet new console
to include .editorconfig
file?
Both but my issue is with regards to dotnet new console
to include .editorconfig file (.NET) template which has the prepopulated default .NET code style, formatting, and naming conventions: https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2019#add-an-editorconfig-file-to-a-project
@mikadumont @jmarolf and I chatted on this. It would be a nightmare to keep all the .editorconfig's consistent if we put them into every template, and then it would be a bad experience for users to wind up with multiple editor config's (per project) instead of one (per repo). That said, we love .editorconfig and want it in every repo :-) Thus, a new more complex feature!
A rough outline:
dotnet new .editorconfig
. Templates will not include .editorconfig.This sounds like another scenario where something like dotnet new repo
would be useful…
The details of the design can be found here (internal).
Audience: template authors
Background
At the moment a lot of .NET project templates have to manually create similar configuration related to:
Moreover more common features will be nice to have:
editorconfig
(original intention of the issue)Implementing all of above is possible but will result in extra ~300 lines configuration in
template.json
and corresponding testing and maintenance effort. The configuration will be very similar to the same in all the templates.Technical suggestion
We are considering to create a specific generator for .NET project templates which implicitly supports the features above. All the author needs to do is to opt-in to desired behaviors via corresponding feature flags.
Justification
original description below Copying Kathleen's comments from below:
The part about -sln is probably not relevant. Therefore, it should be considered out of the scope of this issue.