Skip to content

Commit

Permalink
Update to latest packages
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Aug 25, 2019
1 parent 5ae187e commit 360d54e
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 146 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<LangVersion>7.3</LangVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

</Project>
6 changes: 3 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function __target_build() {
_build_step "Compiling binaries"
_msbuild "xunit.analyzers.sln" $configuration

_dotnet ("tools\DocBuilder\bin\Release\netcoreapp2.0\Xunit.Analyzers.DocBuilder.dll " + (Join-Path $PSScriptRoot "docs")) # "Verifying documentation files"
_dotnet ("tools\DocBuilder\bin\Release\netcoreapp2.1\Xunit.Analyzers.DocBuilder.dll " + (Join-Path $PSScriptRoot "docs")) # "Verifying documentation files"
}

function __target_ci() {
Expand All @@ -64,7 +64,7 @@ function __target_packagerestore() {
_build_step "Restoring NuGet packages"
_mkdir packages
_exec ('& "' + $nugetExe + '" restore xunit.analyzers.sln -NonInteractive')
_exec ('& "' + $nugetExe + '" install xunit.runner.console -OutputDirectory "' + (Join-Path $PSScriptRoot "packages") + '" -NonInteractive -pre -ExcludeVersion')
_exec ('& "' + $nugetExe + '" install xunit.runner.console -OutputDirectory "' + (Join-Path $PSScriptRoot "packages") + '" -NonInteractive -ExcludeVersion')
}

function __target_packages() {
Expand Down Expand Up @@ -130,7 +130,7 @@ function __target__signpackages() {

function __target__test() {
_build_step "Running unit tests"
_xunit_console ("test\xunit.analyzers.tests\bin\" + $configuration + "\net452\xunit.analyzers.tests.dll -xml artifacts\test\TestResults.xml -diagnostics")
_xunit_console ("test\xunit.analyzers.tests\bin\" + $configuration + "\net472\xunit.analyzers.tests.dll -xml artifacts\test\TestResults.xml -diagnostics")
}

# Dispatch
Expand Down
5 changes: 0 additions & 5 deletions global.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected override async Task<Document> GetChangedDocumentAsync(CancellationToke
cancellationToken.ThrowIfCancellationRequested();

var currentType = semanticModel.GetTypeInfo(attribute).Type;
if (currentType == fromTypeSymbol)
if (Equals(currentType, fromTypeSymbol))
editor.SetName(attribute, toTypeName);
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/xunit.analyzers.fixes/xunit.analyzers.fixes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<PackageTargetFallback>portable-net45+win8</PackageTargetFallback>
<RootNamespace>Xunit.Analyzers</RootNamespace>
<TargetFramework>netstandard1.1</TargetFramework>
<TargetFramework>netstandard1.3</TargetFramework>
<DebugType>full</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="1.2.0-beta2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="1.2.2" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.9.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.10.0" />
</ItemGroup>

<ItemGroup>
Expand Down
23 changes: 0 additions & 23 deletions src/xunit.analyzers.vsix/source.extension.vsixmanifest

This file was deleted.

74 changes: 0 additions & 74 deletions src/xunit.analyzers.vsix/xunit.analyzers.vsix.csproj

This file was deleted.

3 changes: 2 additions & 1 deletion src/xunit.analyzers/Analysis/AssertUsageAnalyzerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ protected AssertUsageAnalyzerBase(IEnumerable<DiagnosticDescriptor> descriptors,

public sealed override void Initialize(AnalysisContext context)
{
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
context.EnableConcurrentExecution();

context.RegisterCompilationStartAction(compilationContext =>
Expand All @@ -45,7 +46,7 @@ public sealed override void Initialize(AnalysisContext context)

var methodSymbol = (IMethodSymbol)symbolInfo.Symbol;
if (methodSymbol.MethodKind != MethodKind.Ordinary ||
methodSymbol.ContainingType != assertType ||
!Equals(methodSymbol.ContainingType, assertType) ||
!methodNames.Contains(methodSymbol.Name))
return;

Expand Down
1 change: 1 addition & 0 deletions src/xunit.analyzers/Analysis/XunitDiagnosticAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public XunitDiagnosticAnalyzer(Version versionOverride)

public override void Initialize(AnalysisContext context)
{
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics);
context.EnableConcurrentExecution();

context.RegisterCompilationStartAction(compilationStartContext =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal override void AnalyzeCompilation(CompilationStartAnalysisContext compil
{
var attribute = syntaxNodeContext.Node as AttributeSyntax;
var semanticModel = syntaxNodeContext.SemanticModel;
if (semanticModel.GetTypeInfo(attribute).Type != xunitContext.Core.ClassDataAttributeType)
if (!Equals(semanticModel.GetTypeInfo(attribute).Type, xunitContext.Core.ClassDataAttributeType))
return;

var argumentExpression = attribute.ArgumentList?.Arguments.FirstOrDefault()?.Expression as TypeOfExpressionSyntax;
Expand Down
2 changes: 1 addition & 1 deletion src/xunit.analyzers/InlineDataMustMatchTheoryParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ internal override void AnalyzeCompilation(CompilationStartAnalysisContext compil
? arrayParam.ElementType
: parameter.Type;

if (parameterType == compilation.ObjectType)
if (Equals(parameterType, compilation.ObjectType))
{
// Everything is assignable to object and 'params object[]' so move on
if (xunitSupportsParameterArrays && parameter.IsParams)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private static void AnalyzeMethod(SymbolAnalysisContext context, XunitContext xu
var objectArrayType = TypeSymbolFactory.GetObjectArrayType(context.Compilation);

var wellFormedInlineDataAttributes = methodAllAttributes
.Where(a => a.AttributeClass == xunitContext.Core.InlineDataAttributeType
.Where(a => Equals(a.AttributeClass, xunitContext.Core.InlineDataAttributeType)
&& HasAttributeDeclarationNoCompilationErrors(a, objectArrayType));

AnalyzeInlineDataAttributesWithinTheory(context, wellFormedInlineDataAttributes);
Expand Down
4 changes: 2 additions & 2 deletions src/xunit.analyzers/MemberDataShouldReferenceValidMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal override void AnalyzeCompilation(CompilationStartAnalysisContext compil
{
var attribute = symbolContext.Node as AttributeSyntax;
var semanticModel = symbolContext.SemanticModel;
if (semanticModel.GetTypeInfo(attribute, symbolContext.CancellationToken).Type != xunitContext.Core.MemberDataAttributeType)
if (!Equals(semanticModel.GetTypeInfo(attribute, symbolContext.CancellationToken).Type, xunitContext.Core.MemberDataAttributeType))
return;

var memberNameArgument = attribute.ArgumentList.Arguments.FirstOrDefault();
Expand Down Expand Up @@ -83,7 +83,7 @@ internal override void AnalyzeCompilation(CompilationStartAnalysisContext compil
if (supportsNameofOperator && memberNameArgument.Expression.IsKind(SyntaxKind.StringLiteralExpression))
{
var builder = ImmutableDictionary.CreateBuilder<string, string>();
if (memberSymbol.ContainingType != testClassTypeSymbol)
if (!Equals(memberSymbol.ContainingType, testClassTypeSymbol))
{
builder.Add("DeclaringType", memberSymbol.ContainingType.ToDisplayString());
}
Expand Down
2 changes: 1 addition & 1 deletion src/xunit.analyzers/PublicMethodShouldBeMarkedAsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal override void AnalyzeCompilation(CompilationStartAnalysisContext compil
continue;

if (method.DeclaredAccessibility == Accessibility.Public &&
(method.ReturnsVoid || (taskType != null && method.ReturnType == taskType)))
(method.ReturnsVoid || (taskType != null && Equals(method.ReturnType, taskType))))
{
var shouldIgnore = false;
while (!shouldIgnore || method.IsOverride)
Expand Down
2 changes: 1 addition & 1 deletion src/xunit.analyzers/SymbolExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal static bool ContainsAttributeType(this ImmutableArray<AttributeData> at

internal static INamedTypeSymbol GetGenericInterfaceImplementation(this ITypeSymbol implementingType, INamedTypeSymbol openInterfaceType)
{
return implementingType.AllInterfaces.FirstOrDefault(i => i.OriginalDefinition == openInterfaceType);
return implementingType.AllInterfaces.FirstOrDefault(i => Equals(i.OriginalDefinition, openInterfaceType));
}

internal static ISymbol GetMember(this INamespaceOrTypeSymbol namespaceOrType, string name)
Expand Down
7 changes: 3 additions & 4 deletions src/xunit.analyzers/xunit.analyzers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<PackageTargetFallback>portable-net45+win8</PackageTargetFallback>
<RootNamespace>Xunit.Analyzers</RootNamespace>
<TargetFramework>netstandard1.1</TargetFramework>
<TargetFramework>netstandard1.3</TargetFramework>
<DebugType>full</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="1.2.0-beta2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="1.2.2" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.9.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public abstract class InlineDataMustMatchTheoryParametersTests

public class ForFactMethod : InlineDataMustMatchTheoryParametersTests
{

[Fact]
public async void DoesNotFindError_WhenNoDataAttributes()
{
Expand Down Expand Up @@ -974,7 +973,8 @@ public async void FindsError__ForAnalyzerLessThan_2_4_0v_FromString(string inlin
{
var source = CreateSource(inlineData);

var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer, source);
var diagnosticAnalyzer = new InlineDataMustMatchTheoryParameters("2.3.99");
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(diagnosticAnalyzer, source);

Assert.Collection(diagnostics,
d =>
Expand All @@ -991,7 +991,7 @@ public async void DoesNotFindError_ForAnalyzerGreaterThanEqual_2_4_0v_FromString
{
var source = CreateSource(inlineData);

var diagnosticAnalyzer = new InlineDataMustMatchTheoryParameters("2.5.0");
var diagnosticAnalyzer = new InlineDataMustMatchTheoryParameters("2.4.0");
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(diagnosticAnalyzer, source);

Assert.Empty(diagnostics);
Expand Down
16 changes: 6 additions & 10 deletions test/xunit.analyzers.tests/xunit.analyzers.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,22 @@

<PropertyGroup>
<RootNamespace>Xunit.Analyzers</RootNamespace>
<TargetFramework>net452</TargetFramework>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NSubstitute" Version="2.0.3" />
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
<PackageReference Include="xunit.assert" Version="2.3.1" />
<PackageReference Include="xunit.core" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="xunit.assert" Version="2.4.1" />
<PackageReference Include="xunit.core" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\xunit.analyzers\xunit.analyzers.csproj" />
<ProjectReference Include="..\..\src\xunit.analyzers.fixes\xunit.analyzers.fixes.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
5 changes: 2 additions & 3 deletions tools/DocBuilder/DocBuilder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeFrameworkVersion>2.1.0</RuntimeFrameworkVersion>
<AssemblyName>Xunit.Analyzers.DocBuilder</AssemblyName>
<RootNamespace>Xunit.Analyzers.DocBuilder</RootNamespace>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8;netcore50</PackageTargetFallback>
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
<AssemblyOriginatorKeyFile>..\..\src\signing.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
Expand Down
Loading

0 comments on commit 360d54e

Please sign in to comment.