Skip to content

Commit

Permalink
Bump Roslynator analyzers to 4.8.0 (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt authored Jan 10, 2024
1 parent 9990423 commit f7cb327
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 29 deletions.
22 changes: 17 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ roslynator_accessor_braces_style = single_line_when_expression_is_on_single_line
roslynator_array_creation_type_style = implicit_when_type_is_obvious
roslynator_arrow_token_new_line = before
roslynator_binary_operator_new_line = before
roslynator_blank_line_between_closing_brace_and_switch_section = false
roslynator_blank_line_between_single_line_accessors = false
roslynator_blank_line_between_using_directives = never
roslynator_block_braces_style = multi_line
Expand Down Expand Up @@ -46,14 +45,14 @@ roslynator_enum_flag_value_style = shift_operator
roslynator_blank_line_after_file_scoped_namespace_declaration = true
roslynator_null_check_style = pattern_matching
roslynator_trailing_comma_style = omit_when_single_line
roslynator_use_collection_expression = true
roslynator_blank_line_between_switch_sections = omit
roslynator_use_var = when_type_is_obvious

dotnet_diagnostic.RCS0001.severity = suggestion
dotnet_diagnostic.RCS0003.severity = suggestion
dotnet_diagnostic.RCS0004.severity = suggestion
dotnet_diagnostic.RCS0006.severity = suggestion
dotnet_diagnostic.RCS0008.severity = suggestion
dotnet_diagnostic.RCS0009.severity = suggestion
dotnet_diagnostic.RCS0010.severity = suggestion
dotnet_diagnostic.RCS0011.severity = suggestion
dotnet_diagnostic.RCS0013.severity = suggestion
dotnet_diagnostic.RCS0015.severity = suggestion
Expand Down Expand Up @@ -87,6 +86,7 @@ dotnet_diagnostic.RCS0057.severity = suggestion
dotnet_diagnostic.RCS0058.severity = suggestion
dotnet_diagnostic.RCS0059.severity = suggestion
dotnet_diagnostic.RCS0060.severity = suggestion
dotnet_diagnostic.RCS0061.severity = suggestion
dotnet_diagnostic.RCS1002.severity = silent
dotnet_diagnostic.RCS1006.severity = suggestion
dotnet_diagnostic.RCS1008.severity = suggestion
Expand Down Expand Up @@ -139,6 +139,7 @@ dotnet_diagnostic.RCS1162.severity = suggestion
dotnet_diagnostic.RCS1188.severity = suggestion
dotnet_diagnostic.RCS1189.severity = suggestion
dotnet_diagnostic.RCS1207.severity = suggestion
dotnet_diagnostic.RCS1228.severity = suggestion
dotnet_diagnostic.RCS1237.severity = none
dotnet_diagnostic.RCS1244.severity = suggestion
dotnet_diagnostic.RCS1248.severity = suggestion
Expand All @@ -148,6 +149,8 @@ dotnet_diagnostic.RCS1253.severity = suggestion
dotnet_diagnostic.RCS1254.severity = suggestion
dotnet_diagnostic.RCS1255.severity = suggestion
dotnet_diagnostic.RCS1260.severity = suggestion
dotnet_diagnostic.RCS1264.severity = suggestion
dotnet_diagnostic.RCS9001.severity = suggestion

dotnet_diagnostic.IDE0007.severity = none
dotnet_diagnostic.IDE0007WithoutSuggestion.severity = none
Expand All @@ -171,7 +174,7 @@ dotnet_diagnostic.IDE0026.severity = none
dotnet_diagnostic.IDE0026WithoutSuggestion.severity = none
dotnet_diagnostic.IDE0027.severity = none
dotnet_diagnostic.IDE0027WithoutSuggestion.severity = none
dotnet_diagnostic.IDE0028.severity = suggestion
dotnet_diagnostic.IDE0028.severity = none # Collection initialization can be simplified
dotnet_diagnostic.IDE0029.severity = suggestion
dotnet_diagnostic.IDE0031.severity = suggestion
dotnet_diagnostic.IDE0033.severity = suggestion
Expand All @@ -196,6 +199,11 @@ dotnet_diagnostic.IDE0079.severity = none
dotnet_diagnostic.IDE0090.severity = none
dotnet_diagnostic.IDE0220.severity = none
dotnet_diagnostic.IDE0270.severity = silent
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
dotnet_diagnostic.IDE0300.severity = none # Use collection expression
dotnet_diagnostic.IDE0301.severity = none # ImmutableArray<object>.Empty -> []
dotnet_diagnostic.IDE0303.severity = none # ImmutableArray.Create(x) -> [x]
dotnet_diagnostic.IDE0305.severity = none # x.ToArray() -> [.. x]
dotnet_diagnostic.IDE1005.severity = suggestion
dotnet_diagnostic.IDE1006.severity = suggestion

Expand All @@ -205,4 +213,8 @@ dotnet_diagnostic.RS1026.severity = none

dotnet_diagnostic.CA1806.severity = none
dotnet_diagnostic.CA1826.severity = none
dotnet_diagnostic.CA1860.severity = none
dotnet_diagnostic.CA1861.severity = none
dotnet_diagnostic.CA2231.severity = none

dotnet_diagnostic.SYSLIB1045.severity = silent # Use 'GeneratedRegexAttribute' to generate the regular expression implementation at compile-time.
4 changes: 2 additions & 2 deletions src/CommandLine.Core/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public Command(

public Command WithArguments(IEnumerable<CommandArgument> arguments)
{
return new Command(Name, Description, Group, Alias, arguments, Options);
return new(Name, Description, Group, Alias, arguments, Options);
}

public Command WithOptions(IEnumerable<CommandOption> options)
{
return new Command(Name, Description, Group, Alias, Arguments, options);
return new(Name, Description, Group, Alias, Arguments, options);
}
}
2 changes: 1 addition & 1 deletion src/CommandLine.Core/OptionValueProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public OptionValueProvider WithValues(params OptionValue[] values)

public OptionValueProvider WithValues(string name, params OptionValue[] values)
{
return new OptionValueProvider(name, this, Values.AddRange(values));
return new(name, this, Values.AddRange(values));
}

public OptionValueProvider WithoutValues(params OptionValue[] values)
Expand Down
2 changes: 1 addition & 1 deletion src/CommandLine/Commands/CommonReplaceCommand`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ protected override void WriteSummary(SearchTelemetry telemetry, Verbosity verbos

protected override ContentWriterOptions CreateContentWriterOptions(string indent)
{
return new ContentWriterOptions(
return new(
format: Options.Format,
symbols: Symbols,
highlightOptions: Options.HighlightOptions,
Expand Down
6 changes: 3 additions & 3 deletions src/CommandLine/FilePropertyOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public bool IsEmpty

public FilePropertyOptions WithIncludeCreationTime(bool includeCreationTime)
{
return new FilePropertyOptions(
return new(
includeCreationTime: includeCreationTime,
includeModifiedTime: IncludeModifiedTime,
includeSize: IncludeSize,
Expand All @@ -60,7 +60,7 @@ public FilePropertyOptions WithIncludeCreationTime(bool includeCreationTime)

public FilePropertyOptions WithIncludeModifiedTime(bool includeModifiedTime)
{
return new FilePropertyOptions(
return new(
includeCreationTime: IncludeCreationTime,
includeModifiedTime: includeModifiedTime,
includeSize: IncludeSize,
Expand All @@ -71,7 +71,7 @@ public FilePropertyOptions WithIncludeModifiedTime(bool includeModifiedTime)

public FilePropertyOptions WithIncludeSize(bool includeSize)
{
return new FilePropertyOptions(
return new(
includeCreationTime: IncludeCreationTime,
includeModifiedTime: IncludeModifiedTime,
includeSize: includeSize,
Expand Down
2 changes: 1 addition & 1 deletion src/CommandLine/OutputWriter/OutputCaptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public OutputCaptions Update(
string? shortLength = null,
string? shortSplit = null)
{
return new OutputCaptions(
return new(
match ?? Match,
group ?? Group,
capture ?? Capture,
Expand Down
1 change: 0 additions & 1 deletion src/CommandLine/SortHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ private static SearchResultComparer GetComparer(
{
return (cultureInvariant) ? SearchResultComparer.Name_CultureInvariant : SearchResultComparer.Name;
}

case SortProperty.CreationTime:
return SearchResultComparer.CreationTime;
case SortProperty.ModifiedTime:
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="roslynator.analyzers" Version="4.5.0">
<PackageReference Include="roslynator.analyzers" Version="4.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="roslynator.formatting.analyzers" Version="4.5.0">
<PackageReference Include="roslynator.formatting.analyzers" Version="4.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/FileSystem/FileSystem/Fluent/CopyOperationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public CopyOperationBuilder WithDialogProvider(IDialogProvider<ConflictInfo> dia

internal CopyOptions CreateOptions()
{
return new CopyOptions()
return new()
{
ConflictResolution = _conflictResolution,
ComparedProperties = _comparedProperties,
Expand Down
2 changes: 1 addition & 1 deletion src/FileSystem/FileSystem/Fluent/DeleteOperationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public DeleteOperationBuilder LogOperation(Action<OperationProgress> logOperatio

internal DeleteOptions CreateOptions()
{
return new DeleteOptions()
return new()
{
ContentOnly = _contentOnly,
IncludingBom = _includingBom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public DirectoryMatcherBuilder MaxDepth(int maxDepth)

internal DirectoryMatcher Build()
{
return new DirectoryMatcher()
return new()
{
Name = _name,
NamePart = _namePart ?? FileNamePart.Name,
Expand Down
2 changes: 1 addition & 1 deletion src/FileSystem/FileSystem/Fluent/FileMatcherBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public FileMatcherBuilder NonEmpty()

internal FileMatcher Build()
{
return new FileMatcher()
return new()
{
Name = _name,
NamePart = _namePart ?? FileNamePart.Name,
Expand Down
2 changes: 1 addition & 1 deletion src/FileSystem/FileSystem/Fluent/MoveOperationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public MoveOperationBuilder WithDialogProvider(IDialogProvider<ConflictInfo> dia

internal CopyOptions CreateOptions()
{
return new CopyOptions()
return new()
{
ConflictResolution = _conflictResolution,
ComparedProperties = _comparedProperties,
Expand Down
2 changes: 1 addition & 1 deletion src/FileSystem/FileSystem/Fluent/RenameOperationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public RenameOperationBuilder WithConflictResolution(ConflictResolution conflict

internal RenameOptions CreateOptions()
{
return new RenameOptions()
return new()
{
ReplaceFunctions = _functions,
CultureInvariant = _cultureInvariant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ReplaceOperationBuilder LogOperation(Action<OperationProgress> logOperati

internal ReplaceOptions CreateOptions()
{
return new ReplaceOptions()
return new()
{
ReplaceFunctions = _functions,
CultureInvariant = _cultureInvariant,
Expand Down
6 changes: 3 additions & 3 deletions src/Spelling/Spelling/SpellingData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public SpellingData AddWords(IEnumerable<string> values)

public SpellingData AddWord(string value)
{
return new SpellingData(WordList.AddValue(value), CaseSensitiveWordList, Fixes, IgnoredValues);
return new(WordList.AddValue(value), CaseSensitiveWordList, Fixes, IgnoredValues);
}

public SpellingData AddFix(string error, SpellingFix fix)
Expand All @@ -215,11 +215,11 @@ public SpellingData AddFix(string error, SpellingFix fix)

public SpellingData AddIgnoredValue(string value)
{
return new SpellingData(WordList, CaseSensitiveWordList, Fixes, IgnoredValues.Add(value));
return new(WordList, CaseSensitiveWordList, Fixes, IgnoredValues.Add(value));
}

public SpellingData AddIgnoredValues(IEnumerable<string> values)
{
return new SpellingData(WordList, CaseSensitiveWordList, Fixes, IgnoredValues.Union(values));
return new(WordList, CaseSensitiveWordList, Fixes, IgnoredValues.Union(values));
}
}
2 changes: 1 addition & 1 deletion src/Spelling/Spelling/WordChar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public WordChar(char value, int index)

public static WordChar Create(string value, int index)
{
return new WordChar(value[index], index);
return new(value[index], index);
}

public override bool Equals(object obj)
Expand Down
4 changes: 2 additions & 2 deletions src/Spelling/Spelling/WordList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public bool Contains(string value)

public WordList AddValue(string value)
{
return new WordList(Words.Add(value), Comparison);
return new(Words.Add(value), Comparison);
}

public WordList AddValues(IEnumerable<string> values)
Expand All @@ -109,7 +109,7 @@ public WordList AddValues(WordList wordList, params WordList[] additionalWordLis

public WordList WithValues(IEnumerable<string> values)
{
return new WordList(values, Comparison);
return new(values, Comparison);
}

public static void Save(
Expand Down

0 comments on commit f7cb327

Please sign in to comment.