From 58a515bd46dadb807ff592d8b0c83eeec9443ea1 Mon Sep 17 00:00:00 2001 From: Julien Lebot Date: Wed, 23 Oct 2024 16:13:25 +0200 Subject: [PATCH] Replace clang format with dotnet format for C# files (#30377) --- .pre-commit-config.yaml | 10 +++++++++- tools/windows/DatadogAgentInstaller/.editorconfig | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27f0cdfa3dec2..b68d756cb8d3f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -70,8 +70,16 @@ repos: description: clang-format entry: 'inv pre-commit.check-winclang-format' language: system - types_or: [c, c++, c#] + types_or: [c, c++] pass_filenames: false + - # dotnet format is available on Linux, see https://learn.microsoft.com/en-us/dotnet/core/install/linux + id: dotnet-format-installer + name: dotnet-format-installer + description: Format .net file of the MSI installer + language: system + # The dotnet format tool requires a solution file to operate. + entry: dotnet format ./tools/windows/DatadogAgentInstaller --include + types: [c#] - id: go-mod-tidy name: go-mod-tidy description: check that all go.mod files are tidy diff --git a/tools/windows/DatadogAgentInstaller/.editorconfig b/tools/windows/DatadogAgentInstaller/.editorconfig index 661493b933cf5..7e478b9692106 100644 --- a/tools/windows/DatadogAgentInstaller/.editorconfig +++ b/tools/windows/DatadogAgentInstaller/.editorconfig @@ -6,7 +6,13 @@ indent_style = space tab_width = 4 indent_size = 4 -end_of_line = crlf + +# unset = native (let the platform decide) +# see https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#end_of_line +# > 'if you want to use native line endings between different operating systems it is better not to set this option and leave that task to the VCS' +# and +# https://github.com/editorconfig/editorconfig/issues/226 +# end_of_line = crlf #### .NET Coding Conventions ####