Skip to content

Commit 5397695

Browse files
ci: Run typos tool on docs to catch typos
Seems to have no false positives on the documentation, so seems nice to have in CI. It does have some false positives on `grease*/`, so we can't check that in CI. I ran it manually and fixed some typos. https://github.com/crate-ci/typos
1 parent 8cf2c87 commit 5397695

File tree

16 files changed

+26
-19
lines changed

16 files changed

+26
-19
lines changed

.github/workflows/lint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ jobs:
2424
2525
./hlint-3.8/hlint grease{,-aarch32,-ppc,-x86}/src grease-cli/{main,src,tests}
2626
27+
- name: Spell check docs
28+
# We pin a specific version because updates can come with additional
29+
# typo fixes. These could break CI unexpectedly if we just pinned @v1.
30+
uses: crate-ci/typos@v1.32.0
31+
with:
32+
files: doc/
33+
2734
- name: Find stale TODOs
2835
shell: bash
2936
env:

doc/dev.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ organized into different subdirectories:
158158
test cases has the file extension `*.bc`.
159159

160160
3. `arm`: AArch32 machine-code CFGs (via `macaw-aarch32-syntax`). Each of these
161-
test cases has the file exension `*.armv7l.cbl`.
161+
test cases has the file extension `*.armv7l.cbl`.
162162

163163
4. `ppc32`: PPC32 machine-code CFGs (via `macaw-ppc-syntax`). Each of these test
164-
cases has the file exension `*.ppc32.cbl`.
164+
cases has the file extension `*.ppc32.cbl`.
165165

166166
5. `x86`: x86-64 machine-code CFGs (via `macaw-x86-syntax`). Each of these test
167-
cases has the file exension `*.x64.cbl`.
167+
cases has the file extension `*.x64.cbl`.
168168

169169
### Lua API
170170

doc/memory-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Mutable global variables are tricky:
5050
trigger the bug isn't actually feasible at any of the callsites to the
5151
function under analysis.
5252
- On the other hand, if GREASE doesn't initialize global variables at all, any
53-
loads from them (that aren't preceeded by writes made by the function under
53+
loads from them (that aren't preceded by writes made by the function under
5454
analysis or its callees) will fail. As mutable global variables are pervasive,
5555
this would lead to a significant lack of coverage.
5656

doc/shape-dsl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Where:
3232
- `uninit N` represents `N` uninitialized bytes of memory
3333
- `init N` represents `N` bytes of memory initialized to symbolic bytes
3434
- `exactly byte+` represents a concrete sequence of bytes
35-
- `memptr` represents a pointer to a futher allocation
35+
- `memptr` represents a pointer to a further allocation
3636

3737
At certain verbosity levels, GREASE may output these preconditions in its logs.
3838
It does so using a concrete syntax described below.

doc/shared-libraries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ relocation type associated with the PLT stub, e.g.,
3737
grease: Attempted to read from an unsupported relocation type (R_X86_64_GLOB_DAT) at address 0x3ff0.
3838
This may be due to a PLT stub that grease did not detect.
3939
If so, try passing --plt-stub <ADDR>:<NAME>, where
40-
<ADDR> and <NAME> can be obtained by diassembling the
40+
<ADDR> and <NAME> can be obtained by disassembling the
4141
relevant PLT section of the binary
4242
(.plt, .plt.got, .plt.sec, etc.).
4343
```

doc/undefined-behavior.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In the C abstract machine, such behavior is clearly undefined.
1414
However, if the program is compiled in a straightforward way into machine code, the distinction between different stack variables is lost.
1515
The resulting code simply performs several innocuous-looking writes to the stack.
1616
Similarly, adding two signed integers in C might result in an undefined signed overflow.
17-
At the machine code level, there is no distinction betwen signed and unsigned integers, and arithmetic operations generally have a well-defined semantics for all inputs (e.g., based on a two's complement representation).
17+
At the machine code level, there is no distinction between signed and unsigned integers, and arithmetic operations generally have a well-defined semantics for all inputs (e.g., based on a two's complement representation).
1818

1919
GREASE aims to be pragmatic in what it calls a bug.
2020
It uses a C-like memory model, and reports behaviors of binaries that would likely constitute undefined behavior in C.

grease-cli/tests/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ STRIPPED_STATIC_ARM_EXES = $(addsuffix /test.armv7l.elf,$(STRIPPED_STATIC_DIRS
5858
STRIPPED_STATIC_X64_EXES = $(addsuffix /test.x64.elf,$(STRIPPED_STATIC_DIRS))
5959
STRIPPED_STATIC_PPC32_EXES = $(addsuffix /test.ppc32.elf,$(STRIPPED_STATIC_DIRS))
6060

61-
# Thest test cases depend on libc, but rely on static linking to ensure that
61+
# These test cases depend on libc, but rely on static linking to ensure that
6262
# all of the relevant code from libc is inlined into the binary.
6363
#
6464
# For instance, the sanity/pass/syscall test case crucially relies

grease-cli/tests/llvm/double-free.llvm.cbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
;; next_line_must_fail()
1212
(funcall h p)
1313
(return ())))
14-
; TODO: This error mesage is not great... it doesn't mention double-frees
14+
; TODO: This error message is not great... it doesn't mention double-frees
1515
;; check "The free function"

grease/src/Grease/LLVM/Overrides.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ registerLLVMOverrides la builtinOvs paths bak halloc llvmCtx decls = do
347347
Just ov -> registerOv ov
348348

349349
-- Note the order again: user overrides (registered later) will take
350-
-- precendence over built-in overrides (registered here).
350+
-- precedence over built-in overrides (registered here).
351351
let ovs = Foldable.toList builtinOvs
352352
builtinOvs' <- CLLVM.register_llvm_overrides_ llvmCtx ovs allDecls
353353
builtinOvs'' <-

grease/src/Grease/Macaw.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ assertRelocSupported arch (Mem.LLVMPointer _base offset) relocs =
505505
") at address " <> tshow addr <> "."
506506
, "This may be due to a PLT stub that grease did not detect."
507507
, "If so, try passing --plt-stub <ADDR>:<NAME>, where"
508-
, "<ADDR> and <NAME> can be obtained by diassembling the"
508+
, "<ADDR> and <NAME> can be obtained by disassembling the"
509509
, "relevant PLT section of the binary"
510510
, "(.plt, .plt.got, .plt.sec, etc.)."
511511
]

0 commit comments

Comments
 (0)