-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Add .editorconfig file and apply dotnet-format tool #40
Conversation
@mfkl comments resolved, plz let me know if there're any other outstanding issues |
On your branch, typing
|
@mfkl dotnet format tool does not seems to support custom build sdk yet, so I manually changed build sdk to Microsoft.NET.SDK before running dotnet format, then change it back : ) |
if |
Thats why i included .editorconfig as well. Both vs and vs code has extensions that support .editorconfig |
Sure, but I still didn't figure out how to use it with the VS extension. Either way, we will want to enforce those formatting rules in the CI so running from CLI is a must. |
@mfkl Then maybe u can use some alternative cli tools like https://github.com/editorconfig/editorconfig-core-net which seems to be better done in a separate PR |
@mfkl In my VS2017 and VS2019, when .editorconfig file is in place, it can be automatically picked up when performing formatting (Ctrl + K + D) , does that not work for you? |
I want this to be enforced on build, either when building with msbuild or by feeding the files to an exe. I'm not counting on contributors to think to do CTRL+K+D before each PR. Right now, I still don't get how this works. Example: |
@hanabi1224 ; I tried your branch and did see the IDE displaying messages when I wrote @mfkl , there must be something wrong with your IDE. Did you enable the Error List window? Now, we need to define which rules are applied on LibVLCSharp's repo, because the ones you specified are the rules defined by the dotnet-format team, but for example, I tend to disagree with this rule:
I'd say that a default config (add/new item/editor config (.net)) would be fine for our use, but on the other hand, it would be useful to specify rules like this one (for .sh) : |
Adding a .editorconfig is enough for me at that time. We can try locally, and ask for code style fixes as needed. The automated build failure will come later, but it's not currently supported : dotnet/roslyn#33558 |
@jeremyVignelles Regarding s_ prefix thing, I believed it's sth more general within netfx, https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md |
Fix https://code.videolan.org/videolan/LibVLCSharp/issues/121 by using .editorconfig from https://github.com/dotnet/format/blob/master/.editorconfig
And apply dotnet-format tool