Skip to content

Commit

Permalink
Created a code analyzers project.
Browse files Browse the repository at this point in the history
  • Loading branch information
reduckted committed Sep 19, 2021
1 parent 96fe720 commit 190f035
Show file tree
Hide file tree
Showing 10 changed files with 623 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

# IDE
dotnet_diagnostic.IDE0058.severity = none
dotnet_diagnostic.IDE0058.severity = none
dotnet_diagnostic.RS2008.severity = none # RS2008: Enable analyzer release tracking
21 changes: 21 additions & 0 deletions Community.VisualStudio.Toolkit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{C48F613F-4
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Community.VisualStudio.Toolkit.UnitTests", "test\Community.VisualStudio.Toolkit.UnitTests\Community.VisualStudio.Toolkit.UnitTests.csproj", "{FF58BACD-16B0-4C73-BA03-4A255925153F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Community.VisualStudio.Toolkit.Analyzers", "src\Community.VisualStudio.Toolkit.Analyzers\Community.VisualStudio.Toolkit.Analyzers.csproj", "{8B8B82C4-BF62-48C7-91BF-151B32CB9A4B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Community.VisualStudio.Toolkit.Analyzers.UnitTests", "test\Community.VisualStudio.Toolkit.Analyzers.UnitTests\Community.VisualStudio.Toolkit.Analyzers.UnitTests.csproj", "{6AB57B05-4938-44BB-BBE4-38F3A55D1A54}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Community.VisualStudio.Toolkit.Shared\VSSDK.Helpers.Shared.projitems*{5ec463ac-24cb-443e-9ff9-91b7ecb1f822}*SharedItemsImports = 13
Expand Down Expand Up @@ -91,13 +95,30 @@ Global
{FF58BACD-16B0-4C73-BA03-4A255925153F}.Release|Any CPU.Build.0 = Release|Any CPU
{FF58BACD-16B0-4C73-BA03-4A255925153F}.Release|x86.ActiveCfg = Release|Any CPU
{FF58BACD-16B0-4C73-BA03-4A255925153F}.Release|x86.Build.0 = Release|Any CPU
{8B8B82C4-BF62-48C7-91BF-151B32CB9A4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B8B82C4-BF62-48C7-91BF-151B32CB9A4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B8B82C4-BF62-48C7-91BF-151B32CB9A4B}.Debug|x86.ActiveCfg = Debug|Any CPU
{8B8B82C4-BF62-48C7-91BF-151B32CB9A4B}.Debug|x86.Build.0 = Debug|Any CPU
{8B8B82C4-BF62-48C7-91BF-151B32CB9A4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B8B82C4-BF62-48C7-91BF-151B32CB9A4B}.Release|Any CPU.Build.0 = Release|Any CPU
{8B8B82C4-BF62-48C7-91BF-151B32CB9A4B}.Release|x86.ActiveCfg = Release|Any CPU
{8B8B82C4-BF62-48C7-91BF-151B32CB9A4B}.Release|x86.Build.0 = Release|Any CPU
{6AB57B05-4938-44BB-BBE4-38F3A55D1A54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AB57B05-4938-44BB-BBE4-38F3A55D1A54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AB57B05-4938-44BB-BBE4-38F3A55D1A54}.Debug|x86.ActiveCfg = Debug|Any CPU
{6AB57B05-4938-44BB-BBE4-38F3A55D1A54}.Debug|x86.Build.0 = Debug|Any CPU
{6AB57B05-4938-44BB-BBE4-38F3A55D1A54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AB57B05-4938-44BB-BBE4-38F3A55D1A54}.Release|Any CPU.Build.0 = Release|Any CPU
{6AB57B05-4938-44BB-BBE4-38F3A55D1A54}.Release|x86.ActiveCfg = Release|Any CPU
{6AB57B05-4938-44BB-BBE4-38F3A55D1A54}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7F36F7DF-119E-4175-B1FA-C723EE10BD9B} = {C48F613F-44F9-44F0-BAF5-F2A4F83A67ED}
{FF58BACD-16B0-4C73-BA03-4A255925153F} = {C48F613F-44F9-44F0-BAF5-F2A4F83A67ED}
{6AB57B05-4938-44BB-BBE4-38F3A55D1A54} = {C48F613F-44F9-44F0-BAF5-F2A4F83A67ED}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E0DD67C0-2617-498C-81F0-A5E4FF5831F1}
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ build_script:
- ps: dotnet pack src/Community.VisualStudio.Toolkit.15.0/Community.VisualStudio.Toolkit.15.0.csproj /p:configuration=Release /p:ContinuousIntegrationBuild=true /p:Version=15.0.76.$($env:appveyor_build_number)-pre
- ps: dotnet pack src/Community.VisualStudio.Toolkit.16.0/Community.VisualStudio.Toolkit.16.0.csproj /p:configuration=Release /p:ContinuousIntegrationBuild=true /p:Version=16.0.76.$($env:appveyor_build_number)-pre
- ps: dotnet pack src/Community.VisualStudio.Toolkit.17.0/Community.VisualStudio.Toolkit.17.0.csproj /p:configuration=Release /p:ContinuousIntegrationBuild=true /p:Version=17.0.76.$($env:appveyor_build_number)-pre
- ps: dotnet pack src/Community.VisualStudio.Toolkit.Analyzers/Community.VisualStudio.Toolkit.Analyzers.csproj /p:configuration=Release /p:ContinuousIntegrationBuild=true /p:Version=17.0.76.$($env:appveyor_build_number)-pre

test_script:
- dotnet test test/Community.VisualStudio.Toolkit.UnitTests/Community.VisualStudio.Toolkit.UnitTests.csproj
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\Common.props" />

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<RootNamespace>Community.VisualStudio.Toolkit.Analyzers</RootNamespace>
</PropertyGroup>

<PropertyGroup>
<PackageId>Community.VisualStudio.Toolkit.Analyzers</PackageId>
<Description>Code analyzers for the Community.VisualStudio.Toolkit package.</Description>
<PackageTags>VisualStudio, VSSDK, SDK, analyzers</PackageTags>
<DevelopmentDependency>true</DevelopmentDependency>
<NoPackageAnalysis>true</NoPackageAnalysis>
<IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>

<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddAnalyzersToOutput</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.10.0" />
</ItemGroup>

<ItemGroup>
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<Compile Update="Resources.Designer.cs" DesignTime="True" AutoGen="True" DependentUpon="Resources.resx" />
<EmbeddedResource Update="Resources.resx" Generator="ResXFileCodeGenerator" LastGenOutput="Resources.Designer.cs" />
</ItemGroup>

<Target Name="_AddAnalyzersToOutput">
<ItemGroup>
<TfmSpecificPackageFile Include="$(OutputPath)\Community.VisualStudio.Toolkit.Analyzers.dll" PackagePath="analyzers/dotnet/cs" />
</ItemGroup>
</Target>

</Project>
7 changes: 7 additions & 0 deletions src/Community.VisualStudio.Toolkit.Analyzers/Diagnostics.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Community.VisualStudio.Toolkit.Analyzers
{
public static class Diagnostics
{
public const string CastInteropTypes = "CVST001";
}
}
Loading

0 comments on commit 190f035

Please sign in to comment.