Skip to content

Update dependencies and a bit more #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 22, 2022
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
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="Microsoft.Build.Locator" Version="1.4.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.1.0" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.5.5" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async void Sample() { }
var expected = new DiagnosticResult
{
Id = "INTL0201",
Message = "Async methods should not return void.",
Message = "Async methods should not return void",
Severity = DiagnosticSeverity.Warning,
Locations =
new[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void Main(string[] args)
{
Id = "INTL0202",
Severity = DiagnosticSeverity.Warning,
Message = "Using the symbol 'DateTimeOffset.implicit operator DateTimeOffset(DateTime)' can result in unpredictable behavior.",
Message = "Using the symbol 'DateTimeOffset.implicit operator DateTimeOffset(DateTime)' can result in unpredictable behavior",
Locations =
new[] {
new DiagnosticResultLocation("Test0.cs", 10, 38)
Expand Down Expand Up @@ -71,7 +71,7 @@ static void Main(string[] args)
{
Id = "INTL0202",
Severity = DiagnosticSeverity.Warning,
Message = "Using the symbol 'DateTimeOffset.implicit operator DateTimeOffset(DateTime)' can result in unpredictable behavior.",
Message = "Using the symbol 'DateTimeOffset.implicit operator DateTimeOffset(DateTime)' can result in unpredictable behavior",
Locations =
new[] {
new DiagnosticResultLocation("Test0.cs", 17, 17)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static void Main(string[] args)
{
Id = "INTL0301",
Severity = DiagnosticSeverity.Info,
Message = "Favor using the method `EnumerateFiles` over the `GetFiles` method.",
Message = "Favor using the method `EnumerateFiles` over the `GetFiles` method",
Locations =
new[] {
new DiagnosticResultLocation("Test0.cs", 11, 30)
Expand Down Expand Up @@ -103,7 +103,7 @@ static void Main(string[] args)
{
Id = "INTL0302",
Severity = DiagnosticSeverity.Info,
Message = "Favor using the method `EnumerateDirectories` over the `GetDirectories` method.",
Message = "Favor using the method `EnumerateDirectories` over the `GetDirectories` method",
Locations =
new[] {
new DiagnosticResultLocation("Test0.cs", 11, 30)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void Descriptor_ContainsExpectedValues()
Assert.AreEqual("Flow", diagnostic.Category);
Assert.AreEqual(DiagnosticSeverity.Info, diagnostic.DefaultSeverity);
Assert.AreEqual(true, diagnostic.IsEnabledByDefault);
Assert.AreEqual("All local variables should be accessed, or named with underscores to indicate they are unused", diagnostic.Description);
Assert.AreEqual("All local variables should be accessed, or named with underscores to indicate they are unused.", diagnostic.Description);
Assert.AreEqual("https://github.com/IntelliTect/CodingGuidelines", diagnostic.HelpLinkUri);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; Shipped analyzer releases
; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md

## Release 1.0

### New Rules

Rule ID | Category | Severity | Notes
--------|----------|----------|--------------------
INTL0001 | Naming | Warning | NamingFieldPascalUnderscore
INTL0002 | Naming | Warning | NamingPropertyPascal
INTL0003 | Naming | Warning | NamingMethodPascal
INTL0101 | Formatting | Warning | AttributesOnSeparateLines
INTL0201 | Reliability | Warning | AsyncVoid
INTL0202 | Reliability | Warning | BanImplicitDateTimeToDateTimeOffsetConversion
INTL0301 | Performance | Info | FavorDirectoryEnumerationCalls
INTL0302 | Performance | Info | FavorDirectoryEnumerationCalls
INTL0303 | Flow | Info | UnusedLocalVariable, [Documentation](https://github.com/IntelliTect/CodingGuidelines)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
; Unshipped analyzer release
; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class AsyncVoid : DiagnosticAnalyzer
{
public const string DiagnosticId = "INTL0201";
private const string Title = "Async void methods";
private const string MessageFormat = "Async methods should not return void.";
private const string MessageFormat = "Async methods should not return void";
private const string Description = "Async methods must return either Task or Task<T>.";
private const string Category = "Reliability";
private static readonly string _HelpLinkUri = DiagnosticUrlBuilder.GetUrl(Title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static class Rule202
{
internal const string DiagnosticId = "INTL0202";
internal const string Title = "Do not use implicit conversion from `DateTime` to `DateTimeOffset`";
internal const string MessageFormat = "Using the symbol 'DateTimeOffset.implicit operator DateTimeOffset(DateTime)' can result in unpredictable behavior.";
internal const string MessageFormat = "Using the symbol 'DateTimeOffset.implicit operator DateTimeOffset(DateTime)' can result in unpredictable behavior";
#pragma warning disable INTL0001 // Allow field to not be prefixed with an underscore to match the style
internal static readonly string HelpMessageUri = DiagnosticUrlBuilder.GetUrl(Title,
DiagnosticId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static class Rule301
{
internal const string DiagnosticId = "INTL0301";
internal const string Title = "Favor using EnumerateFiles";
internal const string MessageFormat = "Favor using the method `EnumerateFiles` over the `GetFiles` method.";
internal const string MessageFormat = "Favor using the method `EnumerateFiles` over the `GetFiles` method";
#pragma warning disable INTL0001 // Allow field to not be prefixed with an underscore ot match the style
internal static readonly string HelpMessageUri = DiagnosticUrlBuilder.GetUrl(Title,
DiagnosticId);
Expand All @@ -100,7 +100,7 @@ private static class Rule302
{
internal const string DiagnosticId = "INTL0302";
internal const string Title = "Favor using EnumerateDirectories";
internal const string MessageFormat = "Favor using the method `EnumerateDirectories` over the `GetDirectories` method.";
internal const string MessageFormat = "Favor using the method `EnumerateDirectories` over the `GetDirectories` method";
#pragma warning disable INTL0001 // Allow field to not be prefixed with an underscore ot match the style
internal static readonly string HelpMessageUri = DiagnosticUrlBuilder.GetUrl(Title,
DiagnosticId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class NamingFieldPascalUnderscore : DiagnosticAnalyzer
public const string DiagnosticId = "INTL0001";
private const string Title = "Fields _PascalCase";
private const string MessageFormat = "Field '{0}' should be named _PascalCase";
private const string Description = "All fields should be in the format _PascalCase";
private const string Description = "All fields should be in the format _PascalCase.";
private const string Category = "Naming";
private static readonly string _HelpLinkUri = DiagnosticUrlBuilder.GetUrl(Title,
DiagnosticId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class NamingMethodPascal : DiagnosticAnalyzer
public const string DiagnosticId = "INTL0003";
private const string Title = "Methods PascalCase";
private const string MessageFormat = "Method '{0}' should be PascalCase";
private const string Description = "All methods should be in the format PascalCase";
private const string Description = "All methods should be in the format PascalCase.";
private const string Category = "Naming";
private static readonly string _HelpLinkUri = DiagnosticUrlBuilder.GetUrl(Title,
DiagnosticId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class NamingPropertyPascal : DiagnosticAnalyzer
public const string DiagnosticId = "INTL0002";
private const string Title = "Properties PascalCase";
private const string MessageFormat = "Property '{0}' should be PascalCase";
private const string Description = "All properties should be in the format PascalCase";
private const string Description = "All properties should be in the format PascalCase.";
private const string Category = "Naming";
private static readonly string _HelpLinkUri = DiagnosticUrlBuilder.GetUrl(Title,
DiagnosticId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class UnusedLocalVariable : DiagnosticAnalyzer
public const string DiagnosticId = "INTL0303";
private const string _Title = "Local variable unused";
private const string _MessageFormat = "Local variable '{0}' should be used";
private const string _Description = "All local variables should be accessed, or named with underscores to indicate they are unused";
private const string _Description = "All local variables should be accessed, or named with underscores to indicate they are unused.";
private const string _Category = "Flow";
private const string _HelpLinkUri = "https://github.com/IntelliTect/CodingGuidelines";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)

// Find the enclosing AttributeList
SyntaxNode attributeList = declaration.Parent;
while (attributeList.Kind() != SyntaxKind.AttributeList)
while (!attributeList.IsKind(SyntaxKind.AttributeList))
{
attributeList = attributeList.Parent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.9.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.10" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="NETStandard.Library" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6" />
</ItemGroup>

<ItemGroup>
Expand Down