Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Change CopyrightHeaderRule order to run later #99

Merged
merged 1 commit into from
Aug 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/Microsoft.DotNet.CodeFormatting.Tests/Rules/CombinationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,38 @@ private void M()

Verify(source, expected, runFormatter: false);
}

[Fact]
public void CSharpHeaderCorrectAfterMovingUsings()
{

var source = @"
namespace Microsoft.Build.UnitTests
{
using System;
using System.Reflection;

public class Test
{
public void RequiredRuntimeAttribute()
{}
}
}";
var expected = @"// header

using System;
using System.Reflection;

namespace Microsoft.Build.UnitTests
{
public class Test
{
public void RequiredRuntimeAttribute()
{ }
}
}";

Verify(source, expected);
}
}
}
10 changes: 5 additions & 5 deletions src/Microsoft.DotNet.CodeFormatting/Rules/RuleOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ namespace Microsoft.DotNet.CodeFormatting.Rules
internal static class SyntaxRuleOrder
{
public const int HasNoCustomCopyrightHeaderFormattingRule = 1;
public const int CopyrightHeaderRule = 2;
public const int UsingLocationFormattingRule = 3;
public const int NewLineAboveFormattingRule = 4;
public const int BraceNewLineRule = 6;
public const int NonAsciiChractersAreEscapedInLiterals = 7;
public const int UsingLocationFormattingRule = 2;
public const int NewLineAboveFormattingRule = 3;
public const int BraceNewLineRule = 4;
public const int NonAsciiChractersAreEscapedInLiterals = 5;
public const int CopyrightHeaderRule = 6;
}

// Please keep these values sorted by number, not rule name.
Expand Down