-
Notifications
You must be signed in to change notification settings - Fork 954
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
Nuget lint #8930
Nuget lint #8930
Conversation
8173d29
to
e6836e1
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.
Thanks for opening this PR and helping us stay clean with our codestyle.
Unfortunately the Roslyn formatter does not give us an options to control the formatting of all code structures and there are some intentional formatting decisions that are not captured in the .editorconfig. This is typically not an issue as dotnet format will not change the formatting of this code. However, there are some changes that the Rider/Resharper formatter made that go against our intention as the formatting configuration is not complete.
Would you be willing to update the Rider configuration to ignore object and list initializers as well as line length? Otherwise, we will need to work out the appropriate configuration.
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/SdkPackageUpdater.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.sln.DotSettings.user
Outdated
Show resolved
Hide resolved
.../helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/FrameworkChecker/SupportedFrameworkFacts.cs
Outdated
Show resolved
Hide resolved
Thank you for the review I will process it shortly |
e6836e1
to
46289b3
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.
Thanks for updating this.
After thinking about this more the quickest way to get these changes in is to ask you to revert the Resharper formatting changes and remove the Resharper config. Since the maintainers of this C# do not use this formatter, it would take a bit of work to get the configuration right so that it broke up long lines in a familiar and expected way.
If this is something you feel passionately about, I would be happy to work with you in a separate issue/pr to figure out what the correct Resharper configuration would be.
The added Resharper config is there to conform with the existing code. If I remove it, anyone who makes an update with VS + Resharper / Rider will create style changes, which are again used code style. It only makes the life of contributors easier, the default tooling does not need to understand it. I aim to have such a configuration for Of course, we can spend hours writing formatters that will ensure strictness. That will undoubtedly be awesome, but I do not see a real value. If you insist that all configurations must be used by tooling, there are some possibilities. The easier one is to use Resharper CLI, which comes as a Nuget package. It's stricter than the Another option is to use, e.g., About current changes, the only one I am aware of is an indention of raw string literals, which was written in many different ways in this codebase. I only unified it into one style. |
...t/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs
Outdated
Show resolved
Hide resolved
I believe this is the crux of the issue. The configuration is for dotnet-format but once you run Rider's formatter on the code, it starts making changes that dotnet-format wouldn't. If we can get the Rider's formatter to not break long lines, then I believe we will be in much better shape. |
bc0a308
to
88a1309
Compare
8f867f5
to
c098020
Compare
I believe I addressed all comments and that the PR is ready. |
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.
Thanks @trejjam! I added suggestions for the remaining places we had closing parens on the following line. I also want to add back the removed setting as commented out because we will certainly want to reenable it once the Rider formatter bug is fixed. I know there has been a lot of back and forth on this PR. Thanks for sticking with it.
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/SdkPackageUpdater.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/GlobalJsonUpdater.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs
Outdated
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/SdkPackageUpdater.cs
Outdated
Show resolved
Hide resolved
770014d
to
0f677b8
Compare
0f677b8
to
1f8ab9f
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.
Thanks @trejjam! The test to validate our formatting with dotnet-format is a great addition. Wish I had thought of it. Also, the config changes to interact better with the Rider formatter are good for the community.
Thank you for all the reviews, I like to push things forward :) |
Thanks a lot @trejjam for all the help! |
I'm having this issue as well. Looking for the best workaround until the fix is released. I could remove the grouping from my yml files but then I'd have to put them back later. What I'm thinking is to simply merge the change and then let dependabot re-discover the updates in a subsequent pass. Will that work? |
Dotnet has task
format
, using that, we can format and enforce some codestyle