-
-
Notifications
You must be signed in to change notification settings - Fork 127
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 #404
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I open the solution and build and intentionally write code that doesn't respect the
.editorconfig
file (eg. a local usingvar
), I get no warnings at all 🤔
Could be just a cache issue on Compiler side. I don't have the repo cloned. And I'm replying from mobile. I'll take a look at it soon.
I don't think it's VS caching, as I've also tried on different machines and VS versions, and I never got the warnings. I'm not sure what's different than in the Toolkit repo 🤔 |
6414615
to
7a11cc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, there are 3 issues at play here:
-
XAML files placed inside C# files, leading to dotnet rules not applying to C# files.
-
Code style analyzer does not match the compiler's version leading to
S.C.I
version mismatch. -
An unrelated issue but a warning for missing Appx bundling platforms appears for a sample UWP project.
This patch fixes all of that: 18e2a7e
But I can't push to the PR. You can get my patch from my fork...
git switch dev/editorconfig
git pull --ff-only https://github.com/Nirmal4G/ComputeSharp dev/editorconfig
git push
Ooh, thank you! Yeah using the explicit Roslyn version is annoying, unfortunately we're stuck with that until VS 17.4 is out 🥲 |
Hey @Nirmal4G, so it seems .editorconfig is working now and I did get a bunch of errors, which I fixed in b9c1f2c. I still have a few questions though and there's some things I'm seeing that I don't understand, would you be able to help?
Thank you! 😊 |
1a76c8d
to
bd4e624
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running dotnet format
in the context of an MSBuild solution lead to miss some files that were not included in the solution and its projects. You should run with --folder
for the 2nd time to verify.
Here's the patch with missing files formatted: 1370019
It's in my branch, so same process as before.
It might be due to differences in MSBuild build, VS DesignTime build and a VS regular build. Yes, they differ subtly. Most of the time It should work the same across different build contexts. I'll look into that. |
Thank you! Yeah, I'd really like for all of those warnings to always show up so I can properly enforce them everywhere 🙂 |
a9ebe98
to
e161e34
Compare
@Youssef1313 I've updated my .editorconfig with some better rules (eg. I fixed the fields naming convention), but if I run Note: it's not just about it missing some files, it's also not applying all fixes. Eg. it's not renaming fields correctly. If I open the solution in VS after running it, I still see a bunch of IntelliSense errors for fields named with the wrong style. |
@Sergio0694 What errors about "loading some projects correctly" do you see? |
@Youssef1313 I get all of this 😥 `dotnet format` output (click to expand):
|
7b2bdd0
to
e053617
Compare
I've now enabled all analyzers (just disabled a few I didn't like), and fixed all code to produce 0 warnings 🎉 @Youssef1313 if you take another look let me know if everything looks fine to you! 😄 |
765321d
to
026e671
Compare
There are 3 issues at play here: 1. XAML files placed inside C# files, leading to dotnet rules not applying to C# files. 2. Code style analyzer not matching the compiler's version. 3. Unrelated but warning for missing Appx bundling platforms appears for a sample UWP project. This patch fixes all of that.
026e671
to
e0a8c29
Compare
Description
This PR ports the .editorconfig file from the .NET Community Toolkit (https://github.com/CommunityToolkit/dotnet).
@Nirmal4G this seems like your cup of team, any ideas what might be wrong with this? Could use some help 😄