Skip to content

Commit

Permalink
Fix code style warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrstenke committed Jan 4, 2025
1 parent a62122c commit ef83da9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ dotnet_diagnostic.IDE0150.severity = none

# IDE0074: Use compound assignment
dotnet_diagnostic.IDE0074.severity = none

# IDE0290: Use primary constructor
csharp_style_prefer_primary_constructors = false

# IDE0305: Simplify collection initialization
dotnet_style_prefer_collection_expression = false
5 changes: 3 additions & 2 deletions internal/GenerateModuleRepository/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
Expand Down Expand Up @@ -133,7 +134,7 @@ private static void SetDiagnostics(ModuleConfiguration module, Dictionary<string
continue;
}

foreach (Match match in matches)
foreach (Match match in matches.Cast<Match>())
{
DiagnosticData data = GetDiagnosticData(match, module.Module.Name!, file);

Expand Down Expand Up @@ -518,7 +519,7 @@ private static void WriteDiagnosticData(in DiagnosticData diag, ModuleData modul
builder.Append(
$@" new DiagnosticData(
title: ""{diag.Title}"",
id: {diag.Id!.Substring(5, 2)},
id: {diag.Id!.AsSpan(5, 2)},
docsPath: ""{module.Documentation}/{diag.Id}.md"",
fatal: {diag.Fatal.ToString().ToLower()},
hasLocation: {diag.HasLocation.ToString().ToLower()}");
Expand Down
5 changes: 1 addition & 4 deletions src/Durian.AnalysisServices/Extensions/SymbolFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2082,10 +2082,7 @@ static bool HasObsoleteAttribute(ISymbol symbol)
return symbol.GetAttributes().Any(attr => attr.AttributeClass is
{
MetadataName: nameof(ObsoleteAttribute),
ContainingNamespace:
{
Name: nameof(System)
}
ContainingNamespace.Name: nameof(System)
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,7 @@ public static bool IsDisable(this PragmaWarningDirectiveTriviaSyntax node)
/// <param name="node"><see cref="TypeSyntax"/> to determine whether represents the <see langword="dynamic"/> keyword.</param>
public static bool IsDynamic(this TypeSyntax node)
{
return (node as IdentifierNameSyntax)?.Identifier.ValueText == "dynamic";
return node is IdentifierNameSyntax { Identifier.ValueText: "dynamic" };
}

/// <summary>
Expand Down

0 comments on commit ef83da9

Please sign in to comment.