git-hooks.nix
git-hooks.nix copied to clipboard
hunspell hook errors with can't open affix or dictionary files for dictionary named "default"
What I did
Created a new repository
git init
nix flake init
then replaced the flake.nix with the example flake.nix and replaced the nixpkgs-fmt hook with hunspell. This repository is available at https://github.com/EricCrosson/repro-pre-commit-hooks.nix-hunspell-default-dictionary
Then I ran
echo "cat brown dow fol" > README.md
git add .
git commit -m 'initial commit'
nix flake check
What I expected to happen
Hunspell would print, with one word per line, the incorrect words in README.md:
dow
fol
What actually happened
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /build/src/.git/
[master (root-commit) 25f33b4] init
4 files changed, 115 insertions(+)
create mode 100644 .gitignore
create mode 100644 README.md
create mode 100644 flake.lock
create mode 100644 flake.nix
Running: $ pre-commit run --all-files
hunspell.................................................................Failed
- hook id: hunspell
- exit code: 1
Can't open affix or dictionary files for dictionary named "default".
Notes
I did see hunspell working at one point yesterday, because it found a typo in my project's README, but now I have no idea how!