-
Notifications
You must be signed in to change notification settings - Fork 378
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
dotnet new gitignore should synch up with public template #4126
Comments
After talking to @vlada-shubina we have two use cases for this kind of automatic update:
I think two examples is enough for us to look into making some kind of sync task, either a manual task that whoever is on maintenance detail (like the MSBuild kitten rotation) would do, or make some kind of automation around this. Regarding the specific .gitignore changes proposed by @asears, I'd suggest raising those issues at the gitignore repo, because I do think we should move to just sourcing the data from that repository. Single source of truth and all that. |
I think @kendrahavens may be able to answer the editorconfig question, but not sure. |
I'll pass this to @mikadumont @jmarolf :) |
As Kendra says @baronfel that would be me or Mika. The editorconfig that we generate when the user runs I would like some mechanism so that when the user gets notified when some kinds of templates are out of date. At the very least some explicit command to refresh a template item ( |
Maybe in the future, but as of now there are already missing rules in the EditorConfig file, see #4393 |
Any update on this? If the sync mechanism is still a ways out, would it be possible to get a few updates made to the editorconfig via PR in the meantime? |
We don't have plans to do the sync mechanism for the .NET 7 timeframe currently, but we are open to periodic syncs. There's one happening over at #4598 right now, if you'd like to review and ensure it does what you'd expect it to! |
We should also sync |
We might want to try investigate following tools: |
It would be also good to sync templating/docs folder with Wiki. |
@GangWang01 - please have a look what might be the options for this problem and list some here |
As of SDK version 7.0.100 the .editorconfig template is missing the following rules:
|
|
Possible way for 2nd option: https://git-scm.com/docs/git-filter-branch |
@cremor it is not possible to sync The files that we are looking at in this issue:
|
Summary of issue
The
dotnet new gitignore
command saves a workflow step when scaffolding projects and really happy to seedotnet new --install Microsoft.DotNet.Common.ItemTemplates::6.0.100
and those workflow improvements.Drift between gitignore templates or subtractions in the templates might introduce some security issues if secrets are checked in incorrectly for a new project or while doing a project refresh.
As an example, patches from issues updated in a Feb, 2021 template here are not in a June, 2021 template on GitHub.
Repro
This is the first template which comes up in search results for Visual Studio gitignore when scaffolding a new project.
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
It is different than the template generated using
dotnet new gitignore
from the6.0.100
cli.https://github.com/dotnet/templating/blob/main/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Gitignore/.gitignore
Suggestions
Suggest some background task to synch this repo from GitHub gitignore, as two repos code / PRs diverge and improvements happen.
Source the template from github directly, with some option to download / refresh it for offline consumers.
The template currently provided with dotnet new includes some additional exclusions for mac settings and things that are not really mac settings. Add these to the Github template if required, though are they really needed or is the workflow of a unique developer that could be added to personal/global gitignore? When I see common .gitignore entries for mac, the gitignore list is a lot smaller and usually just include .DS_Store and thumbnails. and config.make, tarballs, etc.
The mac ignores look a little broad (eg. *.tar.gz is not mac-specific, it's a binary archive format) and what is "Mac bundle stuff". The comments could be more specific and professional if introduced via this repo's contributions. These will be in every dotnet project.
As a templating library, could enforce further rules and guidance for .gitignore comments, security and ensure standardization in the gitignore for dotnet.
Files to sync:
.gitignore
template.json
docs
The text was updated successfully, but these errors were encountered: