1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

Add script admin/run-codespell and supporting files

* admin/codespell/README:
* admin/codespell/codespell.dictionary:
* admin/codespell/codespell.exclude:
* admin/codespell/codespell.ignore:
* admin/codespell/codespell.rc:
* admin/run-codespell: New files.
This commit is contained in:
Stefan Kangas 2023-12-10 14:48:33 +01:00
parent 115908469d
commit 1805f4bfd6
6 changed files with 1707 additions and 0 deletions

27
admin/codespell/README Normal file
View File

@ -0,0 +1,27 @@
This directory contains supporting files for running codespell.
See the ./admin/run-codespell script.
codespell.dictionary
This file contains additional, Emacs-specific corrections. When
fixing typos in Emacs, consider adding them to this file.
codespell.exclude
This file contains lines that are correct and should be ignored by
codespell. Add any false positives to this file.
The lines must match lines in the Emacs source tree exactly,
including any whitespace.
codespell.ignore
This file contains any words that are correct in the context of
Emacs, or that we otherwise choose to ignore. Use your best
judgment when adding words to this file. Common typos that are
only correct in highly specific contexts should probably be in
codespell.exclude instead.
codespell.rc
This file contains the Emacs specific codespell configuration.

View File

@ -0,0 +1,17 @@
alis->alist, alias, alas, axis, alms,
boostrap-clean->bootstrap-clean
brunches->branches
defalis->defalias
defalises->defaliases
ecmacs->emacs
ehsell->eshell
emcs->emacs
finis->finish
firs->first
file-writeable-p->file-writable-p
hep->help
least-favourite->least-favorite
lien->line
liens->lines
mecas->emacs
sehell->eshell, shell,

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,41 @@
acknowledgements
afile
ake
analogue
ans
bloc
blocs
callint
clen
crossreference
crossreferences
debbugs
dedented
dependant
doas
ede
grey
gud
ifset
inout
keypair
keyserver
keyservers
lightening
mapp
master
mimicks
mitre
msdos
ot
parm
parms
reenable
reenabled
requestor
sie
spawnve
statics
stdio
texline
typdef

View File

@ -0,0 +1,4 @@
[codespell]
skip=.git/*,*.elc,*.eln,*.gpg,*.gz,*.icns,*.jpg,*.kbx,*.key,*.pbm,*.png,*.rnc,*.so,*.tiff,*.tit,*.xml,*.xpm,*.zip,*random_seed
builtin=clear,rare,en-GB_to_en-US
quiet-level=35

68
admin/run-codespell Executable file
View File

@ -0,0 +1,68 @@
#!/bin/bash
### run-codespell - run codespell on Emacs
## Copyright (C) 2023-2024 Free Software Foundation, Inc.
## Author: Stefan Kangas <stefankangas@gmail.com>
## This file is part of GNU Emacs.
## GNU Emacs is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
## GNU Emacs is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
### Commentary:
## Run codespell on the Emacs source tree.
##
## codespell 2.2.2 or later is recommended. Earlier versions had a
## bug where the line count was incorrect for files containing "^L"
## characters.
source "${0%/*}/emacs-shell-lib"
CODESPELL_DIR="${PD}/codespell"
CODESPELL_RC="${CODESPELL_DIR}/codespell.rc"
CODESPELL_EXCLUDE="${CODESPELL_DIR}/codespell.exclude"
CODESPELL_IGNORE="${CODESPELL_DIR}/codespell.ignore"
CODESPELL_DICTIONARY="${CODESPELL_DIR}/codespell.dictionary"
emacs_run_codespell ()
{
git ls-files |\
grep -v -E -e '^(lib|m4)/.*' |\
grep -v -E -e '^admin/(charsets|codespell|unidata)/.*' |\
grep -v -E -e '^doc/misc/texinfo.tex$' |\
grep -v -E -e '^etc/(AUTHORS|HELLO|publicsuffix.txt)$' |\
grep -v -E -e '^etc/refcards/(cs|de|fr|pl|pt|sk)-.+.tex$' |\
grep -v -E -e '^etc/tutorials/TUTORIAL\..+' |\
grep -v -E -e '^leim/(MISC|SKK)-DIC/.*' |\
grep -v -E -e '^lisp/language/ethio-util.el' |\
grep -v -E -e '^lisp/ldefs-boot.el' |\
grep -v -E -e '^lisp/leim/.*' |\
grep -v -E -e '^test/lisp/net/puny-resources/IdnaTestV2.txt' |\
grep -v -E -e '^test/manual/(etags|indent)/.*' |\
grep -v -E -e '^test/src/regex-resources/.*' |\
xargs codespell \
--config "$CODESPELL_RC" \
--exclude-file "$CODESPELL_EXCLUDE" \
--ignore-words "$CODESPELL_IGNORE" \
--disable-colors \
--write-changes \
$@
}
emacs_run_codespell
emacs_run_codespell --dictionary "$CODESPELL_DICTIONARY"
exit 0