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

Fix EOL in C# project files (#109) #1032

Merged
merged 6 commits into from
Mar 25, 2024

Conversation

Yury-Fridlyand
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand commented Feb 23, 2024

  1. Minor editor config update
  2. Whitespace changes:

\r\n changed to \n by

find . -type f | xargs dos2unix

* Fix EOL in project files.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@Yury-Fridlyand Yury-Fridlyand added the C# C# wrapper label Feb 23, 2024
@Yury-Fridlyand Yury-Fridlyand requested a review from a team as a code owner February 23, 2024 03:37
@shachlanAmazon
Copy link
Contributor

please no style changes without a linter rule to enforce them.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@shachlanAmazon
Copy link
Contributor

What's the .editorconfig change? I can't see it, because of the linebreak change.

@Yury-Fridlyand
Copy link
Collaborator Author

Try Hide whitespaces on GH UI or use CLI
image

git diff -w upstream/main
diff --git a/.editorconfig b/.editorconfig
index abcc6267..49ecca62 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -7,29 +7,21 @@ insert_final_newline = true
 indent_style = space
 indent_size = 4
 tab_width = 4
+end_of_line = lf

 # Xml files
-[*.xml]
+[*.{xml,csproj}]
 indent_size = 2

-# C# files
-[*.cs]
-
-#### Core EditorConfig Options ####
-
-# Indentation and spacing
-
-# New line preferences
-end_of_line = lf
-insert_final_newline = true
-
 #### .NET Coding Conventions ####
 [*.{cs,vb}]

+# License header
+file_header_template = Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0
+
 # Organize usings
 dotnet_separate_import_directive_groups = true
 dotnet_sort_system_directives_first = true
-file_header_template = unset

 # this. and Me. preferences
 dotnet_style_qualification_for_event = false:silent

@shachlanAmazon
Copy link
Contributor

if you change the global editorconfig, you'll need to trigger all of the linters, and check whether this affects other languages. At least the prettier linter takes this into account.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
…fix_eol

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
This reverts commit 3ece3b0.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@Yury-Fridlyand
Copy link
Collaborator Author

I reworked editorconfig - I moved C# related block (98% of the file) to csharp dir and created a symlink into benchmark/csharp to avoid duplicating a big file.
I tried to trigger all our CI in 3ece3b0 and they pass.

IMO no linters we have use editorconfig - it is an IDE recommendation ruleset for new lines, new files, new names, etc, not a requirement.
Prettier uses .editorconfig as a config by default, but it is not enabled on our project. It doesn't lint csproj files though - I tried.

@shachlanAmazon
Copy link
Contributor

@avifenesh rebase over you CI change this and verify that it doesn't change the behavior of prettier.

@Sa1Gur
Copy link
Contributor

Sa1Gur commented Mar 11, 2024

BTW we could make add dotnet_analyzer_diagnostic.category-Style.severity = error to .editorconfig and it will make all codestyle rule breach as error. Not sure if it is desired outcome

@shachlanAmazon
Copy link
Contributor

@Sa1Gur good idea. I don't see the value in warnings - they're just unenforced noise. Either we want the CI to enforce the linting, or we don't care about it.

@Sa1Gur
Copy link
Contributor

Sa1Gur commented Mar 11, 2024

Ok. I will raise PR then

@barshaul
Copy link
Collaborator

@Yury-Fridlyand can it be merged?

@Yury-Fridlyand Yury-Fridlyand merged commit f636236 into valkey-io:main Mar 25, 2024
9 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the csharp/integ_yuryf_fix_eol branch March 25, 2024 19:26
Sa1Gur pushed a commit to Sa1Gur/glide-for-redis that referenced this pull request Mar 25, 2024
* Fix EOL in C# project files (valkey-io#109)

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Sa1Gur pushed a commit to Sa1Gur/glide-for-redis that referenced this pull request Mar 26, 2024
shohamazon pushed a commit to adanWattad/glide-for-redis that referenced this pull request Apr 9, 2024
* Fix EOL in C# project files (valkey-io#109)

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Fix EOL in C# project files (#109)

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# C# wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants