Skip to content

ARROW-8882: [C#] Add .editorconfig to C# code#7246

Closed
eerhardt wants to merge 3 commits intoapache:masterfrom
eerhardt:Editorconfig
Closed

ARROW-8882: [C#] Add .editorconfig to C# code#7246
eerhardt wants to merge 3 commits intoapache:masterfrom
eerhardt:Editorconfig

Conversation

@eerhardt
Copy link
Contributor

Adding an .editorconfig using the rules from dotnet/runtime repo. See:

Violating these rules won't fail the build, but Visual Studio will respect these rules when formatting the code and make suggestions.

The bulk of the violations were var usages. There was one unnecessary usage of this.. And the rest were naming static fields with s_. In BitUtility.cs, I made a slight optimization using the pattern recognized by dotnet/roslyn#24621 instead of prefixing the fields with s_.

Tagging anyone who has contributed to the C# library (please let me know if I missed anyone):
@chutchinson @zgramana @nhustler @HashidaTKS @abbotware @pgovind @stephentoub

@github-actions
Copy link

Copy link

@pgovind pgovind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zgramana
Copy link
Contributor

This is helpful, thanks @eerhardt! Editorconfig is preferable for those of us using VS Code on *nix.

@eerhardt
Copy link
Contributor Author

Also tagging @mr-smidge (sorry I forgot initially)

@emkornfield
Copy link
Contributor

If there is a mechanism to fail the build with these rules I would recommend trying to add it to the list for check to avoid regressions

@eerhardt
Copy link
Contributor Author

If there is a mechanism to fail the build with these rules I would recommend trying to add it to the list for check to avoid regressions

There is an experimental package that hasn't been released yet that will allow for enforcement during the build:

https://dotnet.myget.org/feed/roslyn/package/nuget/Microsoft.CodeAnalysis.CSharp.CodeStyle

When this feature is shipped, we can update to using it to start enforcement of code-style rules.

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.

5 participants