Skip to content

Commit f22c42d

Browse files
committed
infra/linters: Replace spellcheck with typos
Spellcheck is difficult to maintain because it complains about every unknown word, including technical terms, acronyms, and names. Typos is a more relaxed spellchecker, which only complains about common misspellings and lets the user handle new words such as the previous examples. The configuration in .github/.typos.toml allows ignoring strings that match regexes, so we have a nice way of handling command outputs. Signed-off-by: Alex Apostolescu <[email protected]>
1 parent 85302e1 commit f22c42d

File tree

30 files changed

+80
-69
lines changed

30 files changed

+80
-69
lines changed

.github/.typos.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[default]
2+
# ```(console)?[\\s\\S]+?``` -> Ignore fenced sequences
3+
# -\\w+|--\\w+ -> Ignore command flags
4+
extend-ignore-re= ["```(console)?[\\s\\S]+?```", "-\\w+|--\\w+"]
5+
[files]
6+
extend-exclude = ["*.svg", "*.drawio", "ssh_key", "ssh_key.pub"]
7+
[default.extend-words]
8+
# word1 = "word2" to correct word1 to word2
9+
# word3 = "word3" to consider word3 a valid word
10+
VAS = "VAS"

.github/workflows/actions.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ jobs:
2424
with:
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2626

27-
spellcheck:
28-
name: Spellcheck
27+
typos:
28+
name: Typos
2929
runs-on: ubuntu-latest
3030
steps:
31-
- name: Spellcheck
32-
uses: open-education-hub/actions/spellcheck@main
31+
- uses: actions/checkout@v4
32+
- name: Typos
33+
uses: crate-ci/[email protected]
3334
with:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
config: .github/.typos.toml

chapters/compute/processes/guides/sum-array-processes/support/c/sum_array_sequential.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main(void)
3131

3232
time = 1000 * (stop.tv_sec - start.tv_sec) + (stop.tv_usec - start.tv_usec) / 1000;
3333

34-
printf("Array sum is %ld\nTime spent: %lu miliseconds\n", result, time);
34+
printf("Array sum is %ld\nTime spent: %lu milliseconds\n", result, time);
3535

3636
free(array);
3737

chapters/compute/scheduling/drills/tasks/libult/solution/queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void queue_destroy(QUEUE *queue);
5858
size_t queue_size(const QUEUE *queue);
5959

6060

61-
/* Add elem to the end of queue. Returns 0 on succes and non-zero on
61+
/* Add elem to the end of queue. Returns 0 on success and non-zero on
6262
* failure.
6363
*/
6464
int queue_enqueue(QUEUE *queue, TCB *elem);

chapters/compute/scheduling/drills/tasks/libult/support/queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void queue_destroy(QUEUE *queue);
5858
size_t queue_size(const QUEUE *queue);
5959

6060

61-
/* Add elem to the end of queue. Returns 0 on succes and non-zero on
61+
/* Add elem to the end of queue. Returns 0 on success and non-zero on
6262
* failure.
6363
*/
6464
int queue_enqueue(QUEUE *queue, TCB *elem);

chapters/compute/scheduling/guides/libult/solution/queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void queue_destroy(QUEUE *queue);
5858
size_t queue_size(const QUEUE *queue);
5959

6060

61-
/* Add elem to the end of queue. Returns 0 on succes and non-zero on
61+
/* Add elem to the end of queue. Returns 0 on success and non-zero on
6262
* failure.
6363
*/
6464
int queue_enqueue(QUEUE *queue, TCB *elem);

chapters/compute/scheduling/guides/libult/support/queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void queue_destroy(QUEUE *queue);
5858
size_t queue_size(const QUEUE *queue);
5959

6060

61-
/* Add elem to the end of queue. Returns 0 on succes and non-zero on
61+
/* Add elem to the end of queue. Returns 0 on success and non-zero on
6262
* failure.
6363
*/
6464
int queue_enqueue(QUEUE *queue, TCB *elem);

chapters/compute/synchronization/drills/tasks/race-condition/solution/d/race_condition_atomic.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void incrementVar()
1616
// `atomicOp` is a template function. It can perform any simple
1717
// operation, such as `+=`, &= or `-=`, atomically. The operations is
1818
// given to the function as a template argument using the following
19-
// construction: !"+=". The values in parantheses are the operands
19+
// construction: !"+=". The values in parentheses are the operands
2020
// of the atomic operation.
2121
atomicOp!"+="(var, 1);
2222
}

chapters/compute/synchronization/drills/tasks/threadsafe-data-struct/support/clist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef struct CList
5959
/* Returns object with first match of string or byte compare */
6060
void * (* lastMatch) (struct CList *l, const void *o, size_t shift, size_t size, int string);
6161
/* Returns object with last match of string or byte compare */
62-
int (* index) (struct CList *l); /* Get index of previos search match */
62+
int (* index) (struct CList *l); /* Get index of previous search match */
6363
int (* swap) (struct CList *l, int a, int b); /* Swap, replace two items with index a b */
6464
int (* allocSize) (struct CList *l); /* Get allocated size in items */
6565
size_t (* itemSize) (struct CList *l); /* Get item size in bytes */

chapters/compute/synchronization/drills/tasks/threadsafe-data-struct/support/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ int main(void)
242242

243243
/******************************************************* POINTERS LIST */
244244

245-
/* If we want create list of objects located in diffent places of memory, */
245+
/* If we want create list of objects located in different places of memory, */
246246
/* let create pointers list or in our case "uintptr_t" address list */
247247

248248
printf("Size of 'uintptr_t' = %zu bytes\n", sizeof(uintptr_t));

0 commit comments

Comments
 (0)