Skip to content

Commit

Permalink
Merge pull request #6 from 345James/feat/nuget-code-analysis
Browse files Browse the repository at this point in the history
Fixed build issue with analyzers
  • Loading branch information
345paul authored Apr 28, 2021
2 parents 8892c27 + eb262b4 commit 2cd7fdd
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ dotnet_naming_style.pascal_case_style.capitalization = pascal_case

# IDE0073: File header
dotnet_diagnostic.IDE0073.severity = warning
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.
file_header_template = Copyright (c) Microsoft Corporation.\n Licensed under the MIT license.

# CSharp code style settings:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
types: [published]

env:
DOTNET_VERSION: '3.1.200'
DOTNET_VERSION: '5.0.x'
OUTPUT_DIR: 'dist'
BUILD_TYPE: 'Release'
NUGET_SOURCE_NAME: 'AzureIntegrationMigration'
Expand Down
3 changes: 1 addition & 2 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<Version>0.0.4-alpha</Version>
<NoWarn>NU5105</NoWarn>
<AssemblyName>Microsoft.AzureIntegrationMigration.Runner</AssemblyName>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -26,14 +28,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="3.6.0-beta1-20111-10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.8" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>

<AssemblyName>Microsoft.AzureIntegrationMigration.Runner.Tests</AssemblyName>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand All @@ -24,14 +24,6 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="3.6.0-beta1-20111-10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Moq" Version="4.14.5" />
<PackageReference Include="ILogger.Moq" Version="1.1.8" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.IO;
Expand Down Expand Up @@ -136,6 +136,7 @@ public void ConstructWithSuccess(RunnerException rex, Exception e)
/// <param name="e">The runner exception, if any.</param>
[Scenario]
[Trait(TestConstants.TraitCategory, TestConstants.CategoryUnitTest)]
#pragma warning disable SYSLIB0011 // Type or member is obsolete
public void ConstructWithSerializationSuccess(RunnerException rex, IFormatter formatter, MemoryStream stream, Exception e)
{
"Given the runner exception"
Expand Down Expand Up @@ -163,6 +164,7 @@ public void ConstructWithSerializationSuccess(RunnerException rex, IFormatter fo
"And the exception should have our custom message"
.x(() => rex.Message.Should().Be("an error message"));
}
#pragma warning restore SYSLIB0011 // Type or member is obsolete

#endregion
}
Expand Down

0 comments on commit 2cd7fdd

Please sign in to comment.