From 24e478ee112ec77829f42c5cb1903461a4bb7e75 Mon Sep 17 00:00:00 2001 From: hello Date: Thu, 21 Dec 2023 14:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9B=B6=E5=BA=A6=E7=AC=94?= =?UTF-8?q?=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes/visualstudio/copyright.md | 66 ++++++++++++++++++++++++++++++ notes/visualstudio/editorconfig.md | 40 ++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 notes/visualstudio/copyright.md create mode 100644 notes/visualstudio/editorconfig.md diff --git a/notes/visualstudio/copyright.md b/notes/visualstudio/copyright.md new file mode 100644 index 0000000..34af148 --- /dev/null +++ b/notes/visualstudio/copyright.md @@ -0,0 +1,66 @@ +## Copyright + +Generally the copyright notice for a project in the .NET Foundation is given as +"Copyright (c) .NET Foundation and Contributors. All Rights Reserved". +The copyright notice should be placed in the LICENSE for the project so +the beginning of the LICENSE for an MIT Licensed project would be: + + ``` +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors +All Rights Reserved + +Permission is hereby granted... + ``` + +And an Apache 2.0 Licensed project would begin + + ``` +Copyright (c) .NET Foundation and Contributors +All Rights Reserved + +Apache License, Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions... + ``` + +When including third party open source code in a project, any third party +copyright notices should be preserved with the code. It is good practise +to also surface any third party notices required in your project +into a file called NOTICE.md (or ThirdPartyNotices.txt) in the project root. + +## File Headers + +The following file header format is the used for .NET Foundation projects. +Please use it for new files and update the headers of existing code files as +appropriate. Note that the general copyright notice for the project is given +in the project's LICENSE file but any third party copyright notices should be +preserved. + + ``` +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the <> license. +// See the LICENSE file in the project root for more information. + ``` + +Therefore the file header for an MIT licensed project would be: + + ``` +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + ``` + +Where-as the file header for an Apache 2.0 licensed project would be: + + ``` +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. + ``` + +The addition of existing files from other projects is handled on a case by casebasis. diff --git a/notes/visualstudio/editorconfig.md b/notes/visualstudio/editorconfig.md new file mode 100644 index 0000000..5f8c6fa --- /dev/null +++ b/notes/visualstudio/editorconfig.md @@ -0,0 +1,40 @@ +# 关于 EditorConfig 文件 + +EditorConfig 有助于为跨不同编辑器和 IDE 处理同一项目的多个开发人员保持一致的编码风格。 + +EditorConfig 项目由用于定义编码样式的文件格式和文本编辑器插件集合组成,这些插件使编辑器能够读取文件格式并遵循定义的样式。EditorConfig 文件易于读取,并且与版本控制系统配合得很好。 + +[https://editorconfig.org](https://editorconfig.org) + +# Visual Studio 中的 EditorConfig 支持 + +Visual Studio 2019 及更高版本支持 EditorConfig 文件,可以在 Visual Studio 中使用 EditorConfig 文件来定义和维护代码样式设置。 + +[https://github.com/dotnet/aspnetcore/blob/main/.editorconfig](https://github.com/dotnet/aspnetcore/blob/main/.editorconfig) + +# 版权说明模板 + +```ini +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +``` + +``` +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +``` + +# 使用 EditorConfig 添加文件头版权信息 + +在 Visual Studio 中使用 EditorConfig 文件添加文件头版权信息。 + +``` +// Copyright (c) HelloShop Corporation. All rights reserved. +// Licensed under the MIT License. +``` + +``` +file_header_template = Copyright (c) HelloShop Corporation. All rights reserved.\nLicensed under the MIT License. +``` + +