haskell-modules: keep things sorted#401492
haskell-modules: keep things sorted#401492wolfgangwalther merged 5 commits intoNixOS:haskell-updatesfrom
Conversation
|
I think I am generally in favor. My main concern is with the locale config. I don’t know how to do this right and this might be the right way, but I remember that we had a lot of portability issues with that stuff. It is unclear to me whether there is any locale which we can reliably expect to exist on all devs systems. But apparently we already use C.UTF-8 at one place so using it everywhere does not seem worse. Re: Sorting configuration-common.nixI would argue that if we want to enforce sorting in a human edited file then we need CI to enforce it. What command did you use to do the sorting? Our previous approach was: add at random position to avoid merge conflicts as much as possible. But sorting alphabetically achieves a similar goal. Main disadvantage I see is that sometimes it makes sense to sort packages topically and of course enforcing it in CI will annoy people. |
C.UTF-8 is exactly the one "locale" we can rely on. Just
CI already enforces it! It's the "keep-sorted" workflow: https://github.com/NixOS/nixpkgs/actions/runs/14646951951/job/41103466827?pr=401492 To run it locally, just do
Yeah, the upside isn't that big. If "random position to avoid merge conflicts" is the idea, maybe we should explicitly mention that instead. It is the same approach mentioned in the release notes - and there I sure don't have the problem of figuring out where to put stuff. Aka, as someone who wants to do stuff "right", a comment telling me "hey, put it in a random spot" would 100% help my first interaction with that file. |
|
Ah, fair enough. Cool. I am on-the-fence regarding sorting configuration-common.nix. Pro:
Con:
I have really no strong opinion. I like the last two pro arguments, but in the end I fear it is just more bureaucracy. |
|
One more Con:
So the sorting is still a bit inconsistent in the end. |
|
Since the step of sorting this is potentially introducing merge conflicts on it's own, I'll drop that commit and add a note about the preferred random position to the file's header. |
aa3fedf to
9659e84
Compare
9659e84 to
ea4b6ca
Compare
…istently sort -i actually means "ignore nonprinting", not "ignore case". Also, we need to set LC_ALL to get proper sorting for "-".
…n.yaml We have keep-sorted as a CI job for a while, so we can make use of it.
Some outdated comments removed, otherwise moved above their related line.
…ry insert position to avoid merge conflicts
ea4b6ca to
c51d1cd
Compare
| kmonad: [ platforms.darwin ] | ||
|
|
||
| supported-platforms: |
There was a problem hiding this comment.
Thanks for fixing the missing keep-sorted annotations here in 58c2619, @sternenseemann. I guess I was too focused on the rebuilds and confirming the changes in configuration-common.nix not causing changes (which we later removed again). Should have regenerated the hackage set instead.
I suggested to keep things sorted in main.yaml and was nerd-sniped by #400861 (comment).
Commits sorted (!) by potential controversy:
main.yamlin order. I hope we can agree on that.configuration-common.nixare kind of an experiment:When looking at a file like configuration-common.nix, I am always wondering: "OK, and where do I put my new stuff now?". This makes it 100% clear.
Things done
Add a 👍 reaction to pull requests you find important.