Skip to content

Commit

Permalink
Nixfmt (#427)
Browse files Browse the repository at this point in the history
## Description

Add nixfmt to shell.nix so we can check its formatting.

## Why is this needed

Like any fmt-esque tool, its output may differ between different revisions. So let's guard against that.

## How Has This Been Tested?

CI.


## How are existing users impacted? What migration steps/scripts do we need?

N/A
  • Loading branch information
mergify[bot] authored Feb 2, 2021
2 parents 873b0e2 + 43b40d3 commit b24fdf4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
8 changes: 8 additions & 0 deletions ci-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@ if ! git ls-files '*.sh' | xargs shellcheck; then
failed=1
fi

if ! nixfmt shell.nix; then
failed=1
fi

if ! git diff | (! grep .); then
failed=1
fi

exit "$failed"
19 changes: 8 additions & 11 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
let _pkgs = import <nixpkgs> { };
in
{ pkgs ?
import
(_pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs-channels";
#branch@date: nixpkgs-unstable@2020-09-11
rev = "6d4b93323e7f78121f8d6db6c59f3889aa1dd931";
sha256 = "0g2j41cx2w2an5d9kkqvgmada7ssdxqz1zvjd7hi5vif8ag0v5la";
}) { }
}:
in { pkgs ? import (_pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs-channels";
#branch@date: nixpkgs-unstable@2020-09-11
rev = "6d4b93323e7f78121f8d6db6c59f3889aa1dd931";
sha256 = "0g2j41cx2w2an5d9kkqvgmada7ssdxqz1zvjd7hi5vif8ag0v5la";
}) { } }:

with pkgs;

Expand All @@ -21,6 +17,7 @@ mkShell {
go
gotools
jq
nixfmt
nodePackages.prettier
protobuf
protoc-gen-doc
Expand Down

0 comments on commit b24fdf4

Please sign in to comment.