Skip to content

Commit f5b94fe

Browse files
committed
infra/linters: Replace spellcheck with typos
Use typos to find misspelled words since it does not require extensive wordlists and it is easier to configurate. The trade-off is that it will not complain about uncommon typos since it will assume they are technical terms. Overall it should be a lot easier to maintain than spellcheck. Signed-off-by: Alex Apostolescu <[email protected]>
1 parent 85302e1 commit f5b94fe

File tree

32 files changed

+103
-70
lines changed

32 files changed

+103
-70
lines changed

.github/.typos.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 = [
7+
"*.svg",
8+
"*.drawio",
9+
"ssh_key",
10+
"ssh_key.pub",
11+
"content/assignments/async-web-server/src/http-parser/samples/Makefile", # Windows compile flags
12+
# Third-party files
13+
"chapters/compute/processes-threads-apache2/guides/apache2/support/httpd.conf",
14+
"chapters/compute/processes-threads-apache2/drills/tasks/apache2/support/httpd.conf"
15+
]
16+
[default.extend-words]
17+
# word1 = "word2" to correct word1 to word2
18+
# word3 = "word3" to consider word3 a valid word
19+
VAS = "VAS"

.github/workflows/actions.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ 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
33-
with:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Typos
32+
uses: open-education-hub/actions/typos@main

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.formatOnSave": false
3+
}

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,16 @@ clean: stop_bash
3939

4040
cleanall: clean
4141
-docker inspect --type=image $(IMAGE_NAME) > /dev/null 2>&1 && docker image rm $(IMAGE_NAME)
42+
43+
# Linters
44+
.PHONY: lint typos
45+
lint: typos
46+
47+
typos:
48+
@echo "Running crate-ci/typos"
49+
@# Replace ghcr.io/alex-devis/typos:1.28.4 with ghcr.io/crate-ci/typos:latest
50+
@# once https://github.com/crate-ci/typos/pull/1183 or equivalent is merged.
51+
@docker run --rm -v $(PWD):/data -w /data \
52+
ghcr.io/alex-devis/typos:latest \
53+
--config .github/.typos.toml . \
54+
--exclude spellcheck # Do not validate spellcheck wordlist

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
}

0 commit comments

Comments
 (0)