BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

chore: Add .editorfile setting file

Open filzrev opened this issue 1 month ago • 0 comments

This PR add .editorconfig setting file at solution root level.

Background

Currently BenchmakDotNet source code don't enforce linter and following files are mixed.

  • Files that using UTF-8 (with BOM) and UTF-8 (without BOM)
  • Files that using CRLF and LF
  • Files that ends with LF and without LF
  • Other minor code format difference that can be fixed by dotnet format

What's changed this PR

Add .editorconfig file that enforce following settings.

  • Use UTF-8 (without BOM)
  • Use LF
  • Indent settings
  • Enable suggestion for file scoped namespace.
  • Insert LF at end of file. (This setting cause error on CI. it's not included in this PR)

Task after this PR is merged

This PR cause a lot of file changes by dotnet format command and it's hard to review. So diffs are not included in this PR.

Please run following steps by BenchmarkDotNet maintainer side.

  1. Apply dotnet format command to enforce .editorconfig settings with following command.
    dotnet format BenchmarkDotNet.sln -v diagnostic
    dotnet format build/BenchmarkDotNet.Build -v diagnostic
    
  2. Review changes and commit code changes
  3. Edit .editorconfig and set insert_final_newline = true. then execute 1-2 steps.
  4. Push changes.

Note:

  • dotnet format command don't support F# project. so these files are skipped (Warnings are raised when running dotnet format)
  • BenchmarkDotNet.Xamarin.sln is excluded because it seems not maintained.

filzrev avatar Nov 23 '25 23:11 filzrev