Skip to content
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
2 changes: 1 addition & 1 deletion eng/Common.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ dotnet_diagnostic.SA1013.severity = suggestion
dotnet_diagnostic.SA1014.severity = suggestion

# Closing generic bracket should not be followed by a space
dotnet_diagnostic.SA1015.severity = suggestion
dotnet_diagnostic.SA1015.severity = warning

dotnet_diagnostic.SA1019.severity = none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static MockProjectElementLinkRemoter Export<RMock>(ProjectCollectionLink
return exporter.Export<ProjectElement, RMock>(xml);
}

private static bool IsOfType<T> (ProjectElement xml) { return xml is T; }
private static bool IsOfType<T>(ProjectElement xml) { return xml is T; }

private static Dictionary<Type, ExporterFactory> knownTypes = new Dictionary<Type, ExporterFactory>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ internal interface IRemoterSource
/// Base remoter object implementation.
/// </summary>
/// <typeparam name="T"></typeparam>
internal abstract class MockLinkRemoter<T> : ExportedLinksMap.LinkedObject<T> , IRemoterSource
internal abstract class MockLinkRemoter<T> : ExportedLinksMap.LinkedObject<T>, IRemoterSource
where T : class
{
object IRemoterSource.RealObject => this.Source;
Expand Down
4 changes: 2 additions & 2 deletions src/Build.UnitTests/BackEnd/ConfigCache_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public static IEnumerable<object[]> CacheSerializationTestData
new BuildRequestData("path3", new Dictionary<string, string> { ["a3"] = "b3" }, Constants.defaultToolsVersion, new[] { "target3" }, null),
Constants.defaultToolsVersion);

brq3.ProjectDefaultTargets = new List<string>{"target3"};
brq3.ProjectInitialTargets = new List<string>{"targetInitial"};
brq3.ProjectDefaultTargets = new List<string> {"target3"};
brq3.ProjectInitialTargets = new List<string> {"targetInitial"};

var configCache3 = new ConfigCache();
configCache3.AddConfiguration(brq3.ShallowCloneWithNewId(3));
Expand Down
2 changes: 1 addition & 1 deletion src/Build.UnitTests/Evaluation/Expander_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3727,7 +3727,7 @@ public void Medley()
new string[] {"$(Reg:AAA)", ""}
};

var errorTests = new List<string>{
var errorTests = new List<string> {
"$(input[)",
"$(input.ToString()])",
"$(input.ToString()[)",
Expand Down
20 changes: 10 additions & 10 deletions src/Build.UnitTests/Graph/ProjectGraph_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ public void GetTargetListsUsesAllTargetsForNonMultitargetingNodes()

projectGraph.ProjectNodes.Count.ShouldBe(2);

IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string>{"A"});
IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> {"A"});
targetLists.Count.ShouldBe(projectGraph.ProjectNodes.Count);

targetLists[GetFirstNodeWithProjectNumber(projectGraph, 1)].ShouldBe(new[] { "A" });
Expand Down Expand Up @@ -932,7 +932,7 @@ public void GetTargetsListInnerBuildToInnerBuild()

projectGraph.ProjectNodes.Count.ShouldBe(2);

IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string>{"A"});
IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> {"A"});
targetLists.Count.ShouldBe(projectGraph.ProjectNodes.Count);

targetLists[GetFirstNodeWithProjectNumber(projectGraph, 1)].ShouldBe(new[] { "A" });
Expand Down Expand Up @@ -966,7 +966,7 @@ public void GetTargetListsFiltersTargetsForOuterAndInnerBuilds()

projectGraph.ProjectNodes.Count.ShouldBe(4);

IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string>{"A"});
IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> {"A"});

targetLists.Count.ShouldBe(projectGraph.ProjectNodes.Count);
var root = GetFirstNodeWithProjectNumber(projectGraph, 1);
Expand Down Expand Up @@ -1138,7 +1138,7 @@ public void GetTargetListsForComplexMultitargetingGraph()

projectGraph.ProjectNodes.Count.ShouldBe(12);

IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string>{"A"});
IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> {"A"});

targetLists.Count.ShouldBe(projectGraph.ProjectNodes.Count);

Expand Down Expand Up @@ -1724,7 +1724,7 @@ public void InnerBuildAsRootViaGlobalPropertyShouldNotPropagateInnerBuildPropert
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: new[] {2}, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup).Path;
CreateProjectFile(env: _env, projectNumber: 2);

var graph = new ProjectGraph(root, new Dictionary<string, string>{{InnerBuildPropertyName, "foo"}});
var graph = new ProjectGraph(root, new Dictionary<string, string> {{InnerBuildPropertyName, "foo"}});

var dot = graph.ToDot();

Expand Down Expand Up @@ -1789,13 +1789,13 @@ public void InnerBuildsCanHaveSeparateReferences()

innerBuildWithCommonReferences.ProjectReferences.Count.ShouldBe(4);
var referenceNumbersSet = innerBuildWithCommonReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet();
referenceNumbersSet.ShouldBeSameIgnoringOrder(new HashSet<string>{"2", "3"});
referenceNumbersSet.ShouldBeSameIgnoringOrder(new HashSet<string> {"2", "3"});

var innerBuildWithAdditionalReferences = GetNodesWithProjectNumber(graph, 1).First(n => n.ProjectInstance.GlobalProperties.TryGetValue(InnerBuildPropertyName, out string p) && p == "b");

innerBuildWithAdditionalReferences.ProjectReferences.Count.ShouldBe(8);
referenceNumbersSet = innerBuildWithAdditionalReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet();
referenceNumbersSet.ShouldBeSameIgnoringOrder(new HashSet<string>{"2", "3", "4", "5"});
referenceNumbersSet.ShouldBeSameIgnoringOrder(new HashSet<string> {"2", "3", "4", "5"});
}

[Fact]
Expand All @@ -1805,7 +1805,7 @@ public void InnerBuildProducedByOuterBuildCanBeReferencedByAnotherNode()
<ProjectReference Include='1.proj' Properties='{InnerBuildPropertyName}=a'/>
</ItemGroup>";

var additionalGlobalProperties = new Dictionary<string, string>{{"x", "y"}};
var additionalGlobalProperties = new Dictionary<string, string> {{"x", "y"}};

var graph = new ProjectGraph(new []
{
Expand Down Expand Up @@ -1844,7 +1844,7 @@ public void StandaloneInnerBuildsCanBeReferencedWithoutOuterBuilds()
CreateProjectFile(env: _env, projectNumber: 2, projectReferences: new []{3}, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup + $"<PropertyGroup><{InnerBuildPropertyName}>a</{InnerBuildPropertyName}></PropertyGroup>");
CreateProjectFile(env: _env, projectNumber: 3);

var additionalGlobalProperties = new Dictionary<string, string>{{"x", "y"}};
var additionalGlobalProperties = new Dictionary<string, string> {{"x", "y"}};

var graph = new ProjectGraph(root, additionalGlobalProperties);

Expand All @@ -1871,7 +1871,7 @@ public void InnerBuildsProducedByOuterBuildsCanBeReferencedByOtherInnerBuilds()
<ProjectReference Include='2.proj' Condition=`'$({InnerBuildPropertyName})' == 'a'` Properties='{InnerBuildPropertyName}=a'/>
</ItemGroup>".Cleanup();

var additionalGlobalProperties = new Dictionary<string, string>{{"x", "y"}};
var additionalGlobalProperties = new Dictionary<string, string> {{"x", "y"}};

var root = CreateProjectFile(
env: _env,
Expand Down
4 changes: 2 additions & 2 deletions src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public void GraphBuildSwitchCanHaveParameters()
{
CommandLineSwitches switches = new CommandLineSwitches();

MSBuildApp.GatherCommandLineSwitches(new List<string>{ "/graph", "/graph:true; NoBuild ;; ;", "/graph:foo"}, switches);
MSBuildApp.GatherCommandLineSwitches(new List<string> { "/graph", "/graph:true; NoBuild ;; ;", "/graph:foo"}, switches);

switches[CommandLineSwitches.ParameterizedSwitch.GraphBuild].ShouldBe(new[] {"true", " NoBuild ", " ", "foo"});

Expand All @@ -560,7 +560,7 @@ public void GraphBuildSwitchCanBeParameterless()
{
CommandLineSwitches switches = new CommandLineSwitches();

MSBuildApp.GatherCommandLineSwitches(new List<string>{ "/graph" }, switches);
MSBuildApp.GatherCommandLineSwitches(new List<string> { "/graph" }, switches);

switches[CommandLineSwitches.ParameterizedSwitch.GraphBuild].ShouldBe(new string[0]);

Expand Down
4 changes: 2 additions & 2 deletions src/Shared/UnitTests/FileMatcher_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,11 +1360,11 @@ public void FileEnumerationCacheTakesExcludesIntoAccount()
Array.Sort(files);
Assert.Equal(new []{"a.cs", "b.cs", "c.cs"}, files);

files = FileMatcher.Default.GetFiles(testProject.TestRoot, "**/*.cs", new List<string>{"a.cs"});
files = FileMatcher.Default.GetFiles(testProject.TestRoot, "**/*.cs", new List<string> {"a.cs"});
Array.Sort(files);
Assert.Equal(new[] {"b.cs", "c.cs" }, files);

files = FileMatcher.Default.GetFiles(testProject.TestRoot, "**/*.cs", new List<string>{"a.cs", "c.cs"});
files = FileMatcher.Default.GetFiles(testProject.TestRoot, "**/*.cs", new List<string> {"a.cs", "c.cs"});
Array.Sort(files);
Assert.Equal(new[] {"b.cs" }, files);
}
Expand Down