Skip to content

Commit 756cc26

Browse files
authored
Merge pull request #226 from roman/roman/checker/bats-support
feat: add bats checker
2 parents 496e450 + 72b2c3d commit 756cc26

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ use nix
139139

140140
- [shellcheck](https://github.com/koalaman/shellcheck)
141141
- [shfmt](https://github.com/mvdan/sh)
142+
- [bats](https://github.com/bats-core/bats-core)
142143

143144
## Lua
144145

modules/hooks.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,14 @@ in
605605
];
606606
entry = "${tools.shellcheck}/bin/shellcheck";
607607
};
608+
bats =
609+
{
610+
name = "bats";
611+
description = "Run bash unit tests.";
612+
types = [ "shell" ];
613+
types_or = [ "bats" "bash" ];
614+
entry = "${tools.bats}/bin/bats -p";
615+
};
608616
stylua =
609617
{
610618
name = "stylua";

nix/tools.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
, runCommand
3434
, rustfmt
3535
, shellcheck
36+
, bats
3637
, shfmt
3738
, statix
3839
, stylish-haskell
@@ -69,4 +70,5 @@ in
6970
latexindent = tex;
7071
chktex = tex;
7172
commitizen = commitizen.overrideAttrs (_: _: { doCheck = false; });
73+
bats = if bats ? withLibraries then (bats.withLibraries (p: [ p.bats-support p.bats-assert p.bats-file ])) else bats;
7274
}

0 commit comments

Comments
 (0)