aboutsummaryrefslogtreecommitdiffstats
path: root/admin/run-codespell
diff options
context:
space:
mode:
authorStefan Kangas2023-12-10 14:48:33 +0100
committerStefan Kangas2023-12-10 14:48:33 +0100
commitbdf7e646f88a6c67b7b578591ee372b0a55d27d3 (patch)
treef737d4b04d07dd73a177f52fc19724807724da4d /admin/run-codespell
parent2773cf9e013a989df99a689317de941bde2cbf29 (diff)
downloademacs-scratch/codespell.tar.gz
emacs-scratch/codespell.zip
Add script admin/run-codespell and supporting filesscratch/codespell
* admin/codespell/README: * admin/codespell/codespell.dictionary: * admin/codespell/codespell.exclude: * admin/codespell/codespell.ignore: * admin/codespell/codespell.rc: * admin/run-codespell: New files.
Diffstat (limited to 'admin/run-codespell')
-rwxr-xr-xadmin/run-codespell68
1 files changed, 68 insertions, 0 deletions
diff --git a/admin/run-codespell b/admin/run-codespell
new file mode 100755
index 00000000000..384fb528295
--- /dev/null
+++ b/admin/run-codespell
@@ -0,0 +1,68 @@
1#!/bin/bash
2### run-codespell - run codespell on Emacs
3
4## Copyright (C) 2023 Free Software Foundation, Inc.
5
6## Author: Stefan Kangas <stefankangas@gmail.com>
7
8## This file is part of GNU Emacs.
9
10## GNU Emacs is free software: you can redistribute it and/or modify
11## it under the terms of the GNU General Public License as published by
12## the Free Software Foundation, either version 3 of the License, or
13## (at your option) any later version.
14
15## GNU Emacs is distributed in the hope that it will be useful,
16## but WITHOUT ANY WARRANTY; without even the implied warranty of
17## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18## GNU General Public License for more details.
19
20## You should have received a copy of the GNU General Public License
21## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
22
23### Commentary:
24
25## Run codespell on the Emacs source tree.
26##
27## codespell 2.2.2 or later is recommended. Earlier versions had a
28## bug where the line count was incorrect for files containing "^L"
29## characters.
30
31source "${0%/*}/emacs-shell-lib"
32
33CODESPELL_DIR="${PD}/codespell"
34
35CODESPELL_RC="${CODESPELL_DIR}/codespell.rc"
36CODESPELL_EXCLUDE="${CODESPELL_DIR}/codespell.exclude"
37CODESPELL_IGNORE="${CODESPELL_DIR}/codespell.ignore"
38CODESPELL_DICTIONARY="${CODESPELL_DIR}/codespell.dictionary"
39
40emacs_run_codespell ()
41{
42 git ls-files |\
43 grep -v -E -e '^(lib|m4)/.*' |\
44 grep -v -E -e '^admin/(charsets|codespell|unidata)/.*' |\
45 grep -v -E -e '^doc/misc/texinfo.tex$' |\
46 grep -v -E -e '^etc/(AUTHORS|HELLO|publicsuffix.txt)$' |\
47 grep -v -E -e '^etc/refcards/(cs|de|fr|pl|pt|sk)-.+.tex$' |\
48 grep -v -E -e '^etc/tutorials/TUTORIAL\..+' |\
49 grep -v -E -e '^leim/(MISC|SKK)-DIC/.*' |\
50 grep -v -E -e '^lisp/language/ethio-util.el' |\
51 grep -v -E -e '^lisp/ldefs-boot.el' |\
52 grep -v -E -e '^lisp/leim/.*' |\
53 grep -v -E -e '^test/lisp/net/puny-resources/IdnaTestV2.txt' |\
54 grep -v -E -e '^test/manual/(etags|indent)/.*' |\
55 grep -v -E -e '^test/src/regex-resources/.*' |\
56 xargs codespell \
57 --config "$CODESPELL_RC" \
58 --exclude-file "$CODESPELL_EXCLUDE" \
59 --ignore-words "$CODESPELL_IGNORE" \
60 --disable-colors \
61 --write-changes \
62 $@
63}
64
65emacs_run_codespell
66emacs_run_codespell --dictionary "$CODESPELL_DICTIONARY"
67
68exit 0