diff --git a/.github/workflows/check-maintainers-sorted.yml b/.github/workflows/check-maintainers-sorted.yml deleted file mode 100644 index 3b9b5ee7fba2..000000000000 --- a/.github/workflows/check-maintainers-sorted.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "Check that maintainer list is sorted" - -on: - pull_request_target: - paths: - - 'maintainers/maintainer-list.nix' - -permissions: {} - -jobs: - nixos: - name: maintainer-list-check - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: refs/pull/${{ github.event.pull_request.number }}/merge - # Only these directories to perform the check - sparse-checkout: | - lib - maintainers - - - uses: cachix/install-nix-action@526118121621777ccd86f79b04685a9319637641 # v31 - with: - extra_nix_config: sandbox = true - - - name: Check that maintainer-list.nix is sorted - run: nix-instantiate --eval maintainers/scripts/check-maintainers-sorted.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 73941cecfc3d..363ec5e6b2fd 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -65,6 +65,8 @@ file located in the root of the Nixpkgs repo. */ { + # keep-sorted start case=no numeric=no block=yes + _0b11stan = { name = "Tristan Auvinet Pinaudeau"; email = "tristan@tic.sh"; @@ -27450,5 +27452,6 @@ githubId = 59917878; name = "Mathias Zhang"; }; + # keep-sorted end } # Keep the list alphabetically sorted. diff --git a/maintainers/scripts/check-maintainers-sorted.nix b/maintainers/scripts/check-maintainers-sorted.nix deleted file mode 100644 index 606a72c0aa9b..000000000000 --- a/maintainers/scripts/check-maintainers-sorted.nix +++ /dev/null @@ -1,87 +0,0 @@ -let - lib = import ../../lib; - inherit (lib) - add - attrNames - elemAt - foldl' - genList - length - replaceStrings - sort - toLower - trace - ; - - maintainers = import ../maintainer-list.nix; - simplify = replaceStrings [ "-" "_" ] [ "" "" ]; - compare = a: b: simplify (toLower a) < simplify (toLower b); - namesSorted = sort (a: b: a.key < b.key) ( - map ( - n: - let - pos = builtins.unsafeGetAttrPos n maintainers; - in - assert pos == null -> throw "maintainers entry ${n} is malformed"; - { - name = n; - line = pos.line; - key = toLower (simplify n); - } - ) (attrNames maintainers) - ); - before = - { - name, - line, - key, - }: - foldl' ( - acc: n: if n.key < key && (acc == null || n.key > acc.key) then n else acc - ) null namesSorted; - errors = foldl' add 0 ( - map ( - i: - let - a = elemAt namesSorted i; - b = elemAt namesSorted (i + 1); - lim = - let - t = before a; - in - if t == null then "the initial {" else t.name; - in - if a.line >= b.line then - trace ( - "maintainer ${a.name} (line ${toString a.line}) should be listed " - + "after ${lim}, not after ${b.name} (line ${toString b.line})" - ) 1 - else - 0 - ) (genList (i: i) (length namesSorted - 1)) - ); -in -assert errors == 0; -"all good!" - -# generate edit commands to sort the list. -# may everything following the last current entry (closing } ff) in the wrong place -# with lib; -# concatStringsSep -# "\n" -# (let first = foldl' (acc: n: if n.line < acc then n.line else acc) 999999999 namesSorted; -# commands = map -# (i: let e = elemAt namesSorted i; -# begin = foldl' -# (acc: n: if n.line < e.line && n.line > acc then n.line else acc) -# 1 -# namesSorted; -# end = -# foldl' (acc: n: if n.line > e.line && n.line < acc then n.line else acc) -# 999999999 -# namesSorted; -# in "${toString e.line},${toString (end - 1)} p") -# (genList (i: i) (length namesSorted)); -# in map -# (c: "sed -ne '${c}' maintainers/maintainer-list.nix") -# ([ "1,${toString (first - 1)} p" ] ++ commands))