Skip to content

Commit f8a81f7

Browse files
lint: Add spell check linter (codespell)
1 parent ada3562 commit f8a81f7

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

.travis/lint_04_install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66

77
export LC_ALL=C
88

9+
travis_retry pip install codespell
910
travis_retry pip install flake8

test/lint/lint-spelling.ignore-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ cas
22
hights
33
mor
44
objext
5+
unselect
56
useable

test/lint/lint-spelling.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2018 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
#
7+
# Warn in case of spelling errors.
8+
# Note: Will exit successfully regardless of spelling errors.
9+
10+
export LC_ALL=C
11+
12+
IGNORE_WORDS_FILE=test/lint/lint-spelling.ignore-words.txt
13+
if ! codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=${IGNORE_WORDS_FILE} $(git ls-files -- ":(exclude)build-aux/m4/" ":(exclude)contrib/seeds/*.txt" ":(exclude)depends/" ":(exclude)doc/release-notes/" ":(exclude)src/leveldb/" ":(exclude)src/qt/locale/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/"); then
14+
echo "^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in ${IGNORE_WORDS_FILE}"
15+
fi

0 commit comments

Comments
 (0)