Skip to content

Commit 35007d4

Browse files
committed
Add codespell to CI
1 parent 1bbcd50 commit 35007d4

8 files changed

Lines changed: 48 additions & 14 deletions

File tree

.codespellrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[codespell]
2+
skip = *.git*,*.log,*.pdf,*.png,*.jpg,*.jpeg,*.svg,*.ico,*.woff*,*.ttf,*.eot,*.min.*,*.map,*.orig,*.rej,autom4te.cache,build-aux,*.in,*.m4,configure,libtool,compile_commands.json,config.*,*.diff,*.patch,out.txt,configure~,IDE
3+
exclude-file = .gitignore
4+
check-filenames =
5+
check-hidden =
6+
quiet-level = 2

.github/workflows/codespell.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Codespell Check
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
codespell:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.x'
21+
22+
- name: Install codespell
23+
run: pip install codespell
24+
25+
- name: Run codespell
26+
run: |
27+
echo "Running codespell to check for spelling errors..."
28+
codespell . || (echo "❌ Spelling errors found. Please fix the issues above." && exit 1)
29+
echo "✅ No spelling errors found!"

configure.ac

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ for option in $OPTION_FLAGS; do
441441
continue
442442
fi
443443

444-
# allow user to igonore system options
444+
# allow user to ignore system options
445445
ignoresys=no
446446
if [[[ $noequalsign == _* ]]] ;
447447
then
@@ -475,7 +475,7 @@ for option in $DISABLE_DEFS; do
475475
continue
476476
fi
477477

478-
# allow user to igonore system options
478+
# allow user to ignore system options
479479
ignoresys=no
480480
if [[[ $noequalsign == _* ]]] ;
481481
then
@@ -539,4 +539,3 @@ echo " * RSA-OAEP: $ENABLED_RSAOAEP"
539539
echo " * RSA-PSS: $ENABLED_RSAPSS"
540540
echo " * DH: $ENABLED_DH"
541541
echo " * ECC: $ENABLED_ECC"
542-

examples/slot_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static CK_RV pkcs11_slot_info(CK_SLOT_ID slotId)
139139
CHECK_CKR(ret, "Get Slot info");
140140

141141
if (ret == CKR_OK) {
142-
printf("Decription: %.64s\n", slotInfo.slotDescription);
142+
printf("Description: %.64s\n", slotInfo.slotDescription);
143143
printf("Manufacturer Id: %.32s\n", slotInfo.manufacturerID);
144144
printf("Hardware Version: %2x.%02x\n", slotInfo.hardwareVersion.major,
145145
slotInfo.hardwareVersion.minor);

pre-commit.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# save current config
77
echo "\n\nSaving current config\n\n"
88
cp config.status tmp.status
9-
cp wolfpkcs11/options.h tmp.options.h
9+
cp wolfpkcs11/options.h tmp.options.h
1010

1111
# stash modified files not part of this commit, don't test them
1212
echo "\n\nStashing any modified files not part of commit\n\n"
@@ -24,9 +24,9 @@ git stash pop -q
2424
# restore current config
2525
echo "\nRestoring current config\n"
2626
mv tmp.status config.status
27-
# don't show output incase error from above
27+
# don't show output in case error from above
2828
./config.status >/dev/null 2>&1
29-
mv tmp.options.h wolfpkcs11/options.h
29+
mv tmp.options.h wolfpkcs11/options.h
3030
make clean >/dev/null 2>&1
3131
make -j 8 >/dev/null 2>&1
3232

src/slot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static CK_MECHANISM_TYPE mechanismList[] = {
285285
static int mechanismCnt = ((int)(sizeof(mechanismList)/sizeof(*mechanismList)));
286286

287287
/**
288-
* Get list of supported mechanism fo for the slot.
288+
* Get list of supported mechanisms for the slot.
289289
*
290290
* @param slotID [in] Id of slot to use.
291291
* @param pMechanismList [in] Array to hold mechanisms.
@@ -450,7 +450,7 @@ static CK_MECHANISM_INFO hmacSha512MechInfo = {
450450
*
451451
* @param slotID [in] Id of slot to use.
452452
* @param type [in] Mechanism type.
453-
* @param pInfo [in] Mechnism information copied into it.
453+
* @param pInfo [in] Mechanism information copied into it.
454454
* @return CKR_CRYPTOKI_NOT_INITIALIZED when library not initialized.
455455
* CKR_SLOT_ID_INVALID when no slot with id can be found.
456456
* CKR_ARGUMENTS_BAD when pInfo is NULL.
@@ -939,7 +939,7 @@ CK_RV C_SetOperationState(CK_SESSION_HANDLE hSession,
939939
* type.
940940
* CKR_PIN_INCORRECT when PIN is wrong length or does not verify.
941941
* CKR_OPERATION_NOT_INITIALIZED when using user type
942-
* CKU_CONTEXT_SPECIFIC - uesr type not supported.
942+
* CKU_CONTEXT_SPECIFIC - user type not supported.
943943
* CKR_USER_TYPE_INVALID when other user type is specified.
944944
* CKR_OK on success.
945945
*/

tests/pkcs11mtt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3724,7 +3724,7 @@ static CK_RV ecdh_test(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE privKey,
37243724
if (outSz != (word32)sizeof_ecc_secret_256 ||
37253725
memcmp(out, ecc_secret_256, outSz) != 0) {
37263726
ret = -1;
3727-
CHECK_CKR(ret, "Secret compare with exepcted");
3727+
CHECK_CKR(ret, "Secret compare with expected");
37283728
}
37293729
}
37303730
if (ret == CKR_OK) {
@@ -4444,7 +4444,7 @@ static CK_RV dh_test(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE privKey,
44444444
if (outSz != (word32)sizeof_dh_2048_exp ||
44454445
memcmp(out, dh_2048_exp, outSz) != 0) {
44464446
ret = -1;
4447-
CHECK_CKR(ret, "Secret compare with exepcted");
4447+
CHECK_CKR(ret, "Secret compare with expected");
44484448
}
44494449
}
44504450
if (ret == CKR_OK) {

tests/pkcs11test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4831,7 +4831,7 @@ static CK_RV ecdh_test(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE privKey,
48314831
if (outSz != (word32)sizeof_ecc_secret_256 ||
48324832
memcmp(out, ecc_secret_256, outSz) != 0) {
48334833
ret = -1;
4834-
CHECK_CKR(ret, "Secret compare with exepcted");
4834+
CHECK_CKR(ret, "Secret compare with expected");
48354835
}
48364836
}
48374837
if (ret == CKR_OK) {
@@ -5540,7 +5540,7 @@ static CK_RV dh_test(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE privKey,
55405540
if (outSz != (word32)sizeof_dh_2048_exp ||
55415541
memcmp(out, dh_2048_exp, outSz) != 0) {
55425542
ret = -1;
5543-
CHECK_CKR(ret, "Secret compare with exepcted");
5543+
CHECK_CKR(ret, "Secret compare with expected");
55445544
}
55455545
}
55465546
if (ret == CKR_OK) {

0 commit comments

Comments
 (0)