Skip to content

Commit

Permalink
refactor: Pull jq filter into a file and format it
Browse files Browse the repository at this point in the history
Makes the filter much easier to read, now that it's getting more complex.
  • Loading branch information
l0b0 committed Sep 26, 2023
1 parent 49c01c0 commit 6dfe669
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
- uses: actions/checkout@v3
- name: Check format
run: nix-shell --packages jq --pure --run 'diff --unified overrides/build-systems.json <(jq --raw-output --sort-keys ".[] |= sort_by(if type==\"string\" then . else .from != null end)" < overrides/build-systems.json)'
run: nix-shell --packages jq --pure --run 'diff --unified overrides/build-systems.json <(jq --from-file overrides/sort-build-systems.jq --raw-output --sort-keys < overrides/build-systems.json)'

nixpkgs-fmt:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions overrides/sort-build-systems.jq
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.[] |= sort_by(
if type == "string"
then
.
else
.from != null
end
)

0 comments on commit 6dfe669

Please sign in to comment.