You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should make a simple linter to just check for instances of sort.Slice, and replacing it with sort.SliceStable, and sort.Sort -> sort.Stable.
(The application of this change is breaking)
Unstable sort behavior can (validly) change between golang minor releases, so should never be relied upon. Pretty basic issue to get eliminated from our concern list. cref #3762
Ideally this could be in our golangci-linter. If thats hard for whatever reason we can add a custom golang linting step.
Suggested Design
Some basic regex to handle these.
Acceptance Criteria
We have a linter warning for any unstable sort usage.
The text was updated successfully, but these errors were encountered:
Make a grep or a simple CLI command that will return any usage of these, across all go files in the repo.
Require as a step in make lint running this command, ensuring there are 0 such usages. If there are any usages, have an error directing to use the stable variant of that sort.
Check in CI that this is failing in our repo, and fix the failures.
Background
We should make a simple linter to just check for instances of sort.Slice, and replacing it with sort.SliceStable, and sort.Sort -> sort.Stable.
(The application of this change is breaking)
Unstable sort behavior can (validly) change between golang minor releases, so should never be relied upon. Pretty basic issue to get eliminated from our concern list. cref #3762
Ideally this could be in our golangci-linter. If thats hard for whatever reason we can add a custom golang linting step.
Suggested Design
Some basic regex to handle these.
Acceptance Criteria
We have a linter warning for any unstable sort usage.
The text was updated successfully, but these errors were encountered: