File tree Expand file tree Collapse file tree 7 files changed +20
-18
lines changed
Expand file tree Collapse file tree 7 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ script/nglfar2ccov export-ignore
1616script /commit-msg export-ignore
1717script /pre-commit export-ignore
1818.codespellrc export-ignore
19- .aspell .en.pws export-ignore
19+ .hunspell .en.dic export-ignore
2020# no export of website-specific content
2121doc /talk export-ignore
Original file line number Diff line number Diff line change 1111/lint.sum
1212/icdiff
1313/.noicdiff
14- /.aspell.en.prepl
1514/miniconda3
1615/nagelfar *
1716/OpenFOAM-dev
Original file line number Diff line number Diff line change 1- personal_ws-1.1 en 907
21ABBRVLIST
32ActiveTcl
43Adrien
Original file line number Diff line number Diff line change @@ -223,21 +223,21 @@ Commit hooks
223223A :command: `pre-commit ` hook script is provided in the :file: `script `
224224directory of the project to help you check that the contribution made is free
225225of misspellings and trailing spaces. It requires the `codespell `_ utility that
226- checks for typos in any kind of files and the `Aspell `_ utility that spell
226+ checks for typos in any kind of files and the `Hunspell `_ utility that spell
227227checks documentation files. The :command: `pre-commit ` could be enabled in your
228228local repository with following command::
229229
230230 ln -s ../../script/pre-commit .git/hooks/pre-commit
231231
232232A :command: `commit-msg ` hook script is also provided in the :file: `script `
233233directory of the project to help you check that your commit messages are free
234- of misspellings. It requires the `Aspell `_ utility and could be enabled in
234+ of misspellings. It requires the `Hunspell `_ utility and could be enabled in
235235your local repository with following command::
236236
237237 ln -s ../../script/commit-msg .git/hooks/commit-msg
238238
239239.. _codespell : https://github.com/codespell-project/codespell
240- .. _ Aspell : http ://aspell.net /
240+ .. _ Hunspell : https ://hunspell.github.io /
241241
242242Emacs settings for coding conventions
243243~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ Modules 5.3.1 (not yet released)
2121 (fix issue #494)
2222* Fix extra specifier requirement search when module searched is also defining
2323 a requirement and is the sole module to define it. (fix issue #495)
24+ * Script: update :command: `pre-commit ` and :command: `commit-msg ` git hook
25+ scripts to use `Hunspell `_ as spell checker instead of Aspell.
26+
27+ .. _Hunspell : https://hunspell.github.io/
2428
2529
2630Modules 5.3.0 (2023-05-14)
Original file line number Diff line number Diff line change 11#! /bin/bash
22#
33# COMMIT-MSG, hook script to verify commit message
4- # Copyright (C) 2022 Xavier Delaruelle
4+ # Copyright (C) 2022-2023 Xavier Delaruelle
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
@@ -45,11 +45,11 @@ echo_hint() {
4545}
4646
4747# check misspellings in commit message
48- command -v aspell > /dev/null
48+ command -v hunspell > /dev/null
4949if [ $? -eq 0 ]; then
50- ASPELL_OPTS =(-l en -x --home-dir=. --personal=.aspell. en.pws )
50+ HUNSPELL_OPTS =(-d en_US -p .hunspell. en.dic )
5151 # use sed to extract commit message from full commit details
52- words=$( sed ' /^# /Q' " $1 " | aspell " ${ASPELL_OPTS [@]} " list )
52+ words=$( sed ' /^# /Q' " $1 " | hunspell " ${HUNSPELL_OPTS [@]} " -l )
5353 # abort if misspelled words found
5454 if [ -n " $words " ]; then
5555 befmsg=' # commit message was ---------------- >8 -------------'
@@ -60,7 +60,7 @@ if [ $? -eq 0 ]; then
6060 exit 1
6161 fi
6262else
63- echo_warning " aspell command not found"
63+ echo_warning " hunspell command not found"
6464fi
6565
6666exit 0
Original file line number Diff line number Diff line change 11#! /bin/bash
22#
33# PRE-COMMIT, hook script to verify what is about to be committed
4- # Copyright (C) 2022 Xavier Delaruelle
4+ # Copyright (C) 2022-2023 Xavier Delaruelle
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
5252fi
5353
5454# interactively check misspellings in doc files
55- command -v aspell > /dev/null
55+ command -v hunspell > /dev/null
5656if [ $? -eq 0 ]; then
5757 misspell=0
58- ASPELL_OPTS =(-l en -x --home-dir=. --personal=.aspell. en.pws )
58+ HUNSPELL_OPTS =(-d en_US -p .hunspell. en.dic )
5959 for docfile in $( git diff --cached --name-only --diff-filter=d | grep -E\
6060 ' (.rst|.md)$' ) ; do
61- words=$( git diff --cached " $docfile " | grep ' ^[+][^+]' | aspell \
62- " ${ASPELL_OPTS [@]} " list )
61+ words=$( git diff --cached " $docfile " | grep ' ^[+][^+]' | hunspell \
62+ " ${HUNSPELL_OPTS [@]} " -l )
6363 if [ -n " $words " ]; then
6464 # interactively edit file to fix misspellings
65- aspell " ${ASPELL_OPTS [@]} " check " $docfile " < /dev/tty > /dev/tty;
65+ hunspell " ${HUNSPELL_OPTS [@]} " " $docfile " < /dev/tty > /dev/tty;
6666 misspell=1
6767 fi
6868 done
@@ -72,7 +72,7 @@ if [ $? -eq 0 ]; then
7272 exit 1
7373 fi
7474else
75- echo_warning " aspell command not found"
75+ echo_warning " hunspell command not found"
7676fi
7777
7878# fail if there are whitespace errors
You can’t perform that action at this time.
0 commit comments