Skip to content

Commit e67754b

Browse files
authored
Merge pull request #452 from Nirmal4G/build/file-header-template
Use EditorConfig to apply file headers
2 parents bdf9138 + 720e8b8 commit e67754b

File tree

6 files changed

+14
-96
lines changed

6 files changed

+14
-96
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ insert_final_newline = true
4444
# C# files
4545
[*.cs]
4646

47+
#### File Header Template ####
48+
file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.\nSee the LICENSE file in the project root for more information.
49+
4750
#### .NET Coding Conventions ####
4851

4952
# this. and Me. preferences
@@ -342,6 +345,9 @@ dotnet_diagnostic.CA2240.severity = warning
342345
dotnet_diagnostic.CA2241.severity = warning
343346
dotnet_diagnostic.CA2242.severity = warning
344347

348+
# Require file header OR A source file contains a header that does not match the required text
349+
dotnet_diagnostic.IDE0073.severity = error
350+
345351
# StyleCop Code Analysis
346352

347353
# Closing parenthesis should be spaced correctly: "foo()!"

CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/SuppressionDescriptors.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
15
using Microsoft.CodeAnalysis;
26

37
namespace CommunityToolkit.Mvvm.SourceGenerators.Diagnostics;

azure-pipelines.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ jobs:
4444
- script: nbgv cloud
4545
displayName: Set NBGV version
4646

47-
# Verify headers
48-
- pwsh: build/Update-Headers.ps1 -Verify
49-
displayName: Verify headers
50-
5147
# Restore solution
5248
- script: dotnet restore -p:Configuration=$(Build.Configuration)
5349
displayName: Restore solution

build/Community.Toolkit.Common.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<PackageIconUrl>https://raw.githubusercontent.com/CommunityToolkit/dotnet/main/build/nuget.png</PackageIconUrl>
1515
</PropertyGroup>
1616

17+
<PropertyGroup>
18+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
19+
</PropertyGroup>
20+
1721
<PropertyGroup>
1822
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1923
<LangVersion>10.0</LangVersion>

build/Update-Headers.ps1

Lines changed: 0 additions & 89 deletions
This file was deleted.

build/header.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)