diff options
Diffstat (limited to '')
-rw-r--r-- | default.nix | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/default.nix b/default.nix index 9a8af74..a5d6f4e 100644 --- a/default.nix +++ b/default.nix @@ -67,7 +67,26 @@ with pkgs.stdenv; rec { name = "${baseAttrs.name}-nixfmt"; buildInputs = baseAttrs.buildInputs ++ [nixfmt]; buildPhase = '' - diff <(nixfmt < default.nix) default.nix + diff <(nixfmt < default.nix) default.nix || { + echo "The default.nix is unformatted. To fix it, run:" + echo " nixfmt default.nix" + exit 1 + } + touch $out + ''; + }); + hunspellCheck = baseTask.overrideAttrs (baseAttrs: { + name = "${baseAttrs.name}-hunspell"; + buildInputs = baseAttrs.buildInputs + ++ [(hunspellWithDicts (with hunspellDicts; [en-us]))]; + buildPhase = '' + DICT="spelling/en_US-dict.txt" + diff <(sort --ignore-case $DICT) $DICT || { + echo "The $DICT dictionary is unsorted. To fix it, run:" + echo " sort $DICT | sort --ignore-case | sponge $DICT" + exit 1 + } + touch $out ''; }); @@ -95,6 +114,7 @@ with pkgs.stdenv; rec { subtasks.batsTest subtasks.perlInternalTest subtasks.formatNix + subtasks.hunspellCheck ]; buildPhase = '' echo "Ran tests for:" @@ -111,6 +131,7 @@ with pkgs.stdenv; rec { websiteBuilder (pkgs.haskellPackages.ghcWithPackages (p: with p; [hakyll])) nixfmt + (hunspellWithDicts (with hunspellDicts; [en-us])) ]; }; publishScript = pkgs.writeShellScriptBin "publish.sh" '' |