spelling: add ignore list
Thu Ba reported that their name is getting rejected as a spelling
mistake in their Signed-off-by. Add capability to ignore words
from the primary dictionaries and add 'ba' to the ignore list.
Tested:
Before change, manually running codespell results in:
```
./config/openbmc-spelling-ignore.txt:1: Ba ==> By, be
```
Manually running codespell with ignore-list option removes this.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I33134e519e28024926b6da00340d2d52e2e884bd
diff --git a/config/openbmc-spelling-ignore.txt b/config/openbmc-spelling-ignore.txt
new file mode 100644
index 0000000..86ae29c
--- /dev/null
+++ b/config/openbmc-spelling-ignore.txt
@@ -0,0 +1 @@
+ba
diff --git a/run-unit-test-docker.sh b/run-unit-test-docker.sh
index dc0db9c..bbf49df 100755
--- a/run-unit-test-docker.sh
+++ b/run-unit-test-docker.sh
@@ -37,7 +37,7 @@
CONFIG_DIR="config"
UNIT_TEST_PY="unit-test.py"
FORMAT_CODE_SH="format-code.sh"
-SPELLINGS_TXT="openbmc-spelling.txt"
+SPELLINGS_TXT="openbmc-spelling.txt openbmc-spelling-ignore.txt"
ESLINT_CONFIG="eslint-global-config.json"
DBUS_UNIT_TEST_PY="dbus-unit-test.py"
TEST_ONLY="${TEST_ONLY:-}"
@@ -82,8 +82,10 @@
chmod a+x "${WORKSPACE}"/${FORMAT_CODE_SH}
# Copy spellings.txt file into workspace
-cp "${WORKSPACE}"/${OBMC_BUILD_SCRIPTS}/${CONFIG_DIR}/${SPELLINGS_TXT} \
-"${WORKSPACE}"/${SPELLINGS_TXT}
+for f in ${SPELLINGS_TXT}; do
+ cp "${WORKSPACE}/${OBMC_BUILD_SCRIPTS}/${CONFIG_DIR}/${f}" \
+ "${WORKSPACE}/${f}"
+done
# Copy the eslintconfig file into workspce
cp "${WORKSPACE}"/${OBMC_BUILD_SCRIPTS}/${CONFIG_DIR}/${ESLINT_CONFIG} \
diff --git a/scripts/format-code.sh b/scripts/format-code.sh
index 0609d9f..23a4dd8 100755
--- a/scripts/format-code.sh
+++ b/scripts/format-code.sh
@@ -22,7 +22,9 @@
# Run the codespell with generic dictionary on the patchset
echo "generic-dictionary - misspelling count >> "
-codespell --builtin clear,rare,en-GB_to_en-US -d --count "${DIR}"/.git/COMMIT_EDITMSG
+codespell --builtin clear,rare,en-GB_to_en-US -d --count \
+ --ignore-words=openbmc-spelling-ignore.txt \
+ "${DIR}"/.git/COMMIT_EDITMSG
cd "${DIR}"