Skip to content
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

chore: Apply code formatting rules (IDE0028, and IDE0300-IDE0304) #10458

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Dec 14, 2024

This PR intended to fix a part of issue #9207.

What's changed in this PR

Steps

  1. Set following temporary settings to .editorconfig
    dotnet_style_collection_initializer = true:warning                                 # IDE0028: Use collection initializers or expressions
    dotnet_style_prefer_collection_expression = true:warning                           # IDE0028: Use collection initializers or expressions
    dotnet_diagnostic.IDE0300.severity = warning                                       # IDE0300: Use collection expression for array
    dotnet_diagnostic.IDE0301.severity = warning                                       # IDE0301: Use collection expression for empty
    dotnet_diagnostic.IDE0302.severity = warning                                       # IDE0302: Use collection expression for stackalloc
    dotnet_diagnostic.IDE0303.severity = warning                                       # IDE0303: Use collection expression for Create()
    dotnet_diagnostic.IDE0304.severity = warning                                       # IDE0304: Use collection expression for builder
    dotnet_diagnostic.IDE0305.severity = suggestion                                    # IDE0305: Use collection expression for fluent
    dotnet_diagnostic.IDE0306.severity = suggestion                                    # IDE0306: Use collection expression for new
    
  2. Run dotnet format command and apply auto code fixers.
  3. Revert some changes that are converting code to use spread operator syntax.
    (Currently there is no options to control this behavior)
  4. Manually adjust extra newline.

Copy link

codecov bot commented Dec 14, 2024

Codecov Report

Attention: Patch coverage is 84.22819% with 47 lines in your changes missing coverage. Please review.

Project coverage is 79.39%. Comparing base (fe673ec) to head (1466228).
Report is 494 commits behind head on main.

Files with missing lines Patch % Lines
...ld.ManagedReference/SplitClassPageToMemberLevel.cs 0.00% 6 Missing ⚠️
.../ManagedReference/Visitors/SymbolVisitorAdapter.cs 81.48% 5 Missing ⚠️
.../Docfx.Dotnet/DotnetApiCatalog.ManagedReference.cs 40.00% 0 Missing and 3 partials ⚠️
src/Docfx.App/Helpers/DocumentBuilderWrapper.cs 0.00% 0 Missing and 2 partials ⚠️
src/Docfx.App/Helpers/MetadataMerger.cs 0.00% 2 Missing ⚠️
src/Docfx.Build/SingleDocumentBuilder.cs 66.66% 2 Missing ⚠️
src/Docfx.App/Config/FileMetadataPairs.cs 0.00% 1 Missing ⚠️
src/Docfx.App/Config/GroupConfig.cs 0.00% 1 Missing ⚠️
src/Docfx.App/RunMerge.cs 0.00% 1 Missing ⚠️
...cfx.Build.ManagedReference/ApplyPlatformVersion.cs 0.00% 1 Missing ⚠️
... and 23 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10458      +/-   ##
==========================================
+ Coverage   74.31%   79.39%   +5.07%     
==========================================
  Files         536      547      +11     
  Lines       23189    23615     +426     
  Branches     4056     4061       +5     
==========================================
+ Hits        17234    18750    +1516     
+ Misses       4853     3695    -1158     
- Partials     1102     1170      +68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@filzrev filzrev force-pushed the chore-fix-analyzer-rules branch from c78eebe to 1466228 Compare December 14, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant