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

Usings sorting differs based on system culture #1051

Closed
davidkudera opened this issue Nov 30, 2023 · 2 comments · Fixed by #1052
Closed

Usings sorting differs based on system culture #1051

davidkudera opened this issue Nov 30, 2023 · 2 comments · Fixed by #1052
Assignees
Milestone

Comments

@davidkudera
Copy link
Contributor

davidkudera commented Nov 30, 2023

It seems that system culture affects the usings ordering. I use cs-CZ culture on my PC, but our CI has en-US. This creates different lists in different environments.

For example this:

using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;

gets sorted like this in Czech:

using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.Channel;

This is because in Czech the ch is a "single letter" which is part of our alphabet and is placed between h and i.

When ordering the usings it should probably just always use something like Ordinal (https://learn.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings#recommendations-for-string-usage).

This started happening after upgrading from version 0.25.0 to 0.26.3 as part of our .net 8 upgrade.

@davidkudera
Copy link
Contributor Author

.assign

@loraderon
Copy link
Contributor

Is this an intended side effect? 0.26.4 sorts NSubstitute before Newtonsoft.Json

image

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 a pull request may close this issue.

3 participants