Skip to content

Commit 923e4f1

Browse files
committed
Add typos
1 parent 84dc0bd commit 923e4f1

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ use nix
149149
## Spell checkers
150150

151151
- [hunspell](https://github.com/hunspell/hunspell)
152+
- [typos](https://github.com/crate-ci/typos)
152153

153154
## Other Formatters
154155

modules/hooks.nix

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,29 @@ in
154154
default = "\\.js$";
155155
};
156156
};
157+
typos =
158+
{
159+
write =
160+
mkOption {
161+
type = types.bool;
162+
description = lib.mdDoc "Whether to write fixes out.";
163+
default = false;
164+
};
165+
166+
diff =
167+
mkOption {
168+
type = types.bool;
169+
description = lib.mdDoc "Wheter to print a diff of what would change.";
170+
default = false;
171+
};
172+
173+
format =
174+
mkOption {
175+
type = types.enum [ "silent" "brief" "long" "json" ];
176+
description = lib.mdDoc "Output format.";
177+
default = "long";
178+
};
179+
};
157180

158181
revive =
159182
{
@@ -529,6 +552,13 @@ in
529552
entry = "${tools.hunspell}/bin/hunspell -l";
530553
files = "\\.((txt)|(html)|(xml)|(md)|(rst)|(tex)|(odf)|\\d)$";
531554
};
555+
typos =
556+
{
557+
name = "typos";
558+
description = "Source code spell checker";
559+
entry = with settings.typos;
560+
"${tools.typos}/bin/typos --format ${format} ${lib.optionalString write "-w"} ${lib.optionalString diff "--diff"}";
561+
};
532562
html-tidy =
533563
{
534564
name = "html-tidy";

nix/tools.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@
3636
, stylish-haskell
3737
, stylua
3838
, texlive
39+
, typos
3940
, writeScript
4041
, writeText
4142
, go
4243
, revive ? null
4344
}:
4445

4546
{
46-
inherit actionlint alejandra cabal-fmt cabal2nix cargo clang-tools clippy deadnix dhall hadolint hindent hlint hpack html-tidy nix-linter nixfmt nixpkgs-fmt ormolu rustfmt shellcheck shfmt statix stylish-haskell stylua go mdsh revive;
47+
inherit actionlint alejandra cabal-fmt cabal2nix cargo clang-tools clippy deadnix dhall hadolint hindent hlint hpack html-tidy nix-linter nixfmt nixpkgs-fmt ormolu rustfmt shellcheck shfmt statix stylish-haskell stylua typos go mdsh revive;
4748
inherit (elmPackages) elm-format elm-review elm-test;
4849
# TODO: these two should be statically compiled
4950
inherit (haskellPackages) brittany fourmolu;

0 commit comments

Comments
 (0)