@@ -19,6 +19,7 @@ Dual-licensed under [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE)
19
19
## Documentation
20
20
21
21
- [ Installation] ( #install )
22
+ - [ Getting Started] ( #getting-started )
22
23
- [ Reference] ( docs/reference.md )
23
24
- [ Comparison with other spell checkers] ( docs/comparison.md )
24
25
- [ Benchmarks] ( benchsuite/runs )
@@ -36,5 +37,57 @@ Or use rust to install:
36
37
cargo install typos-cli
37
38
```
38
39
40
+ ## Getting Started
41
+
42
+ Most commonly, you'll either want to see what typos are available with
43
+ ``` bash
44
+ typos
45
+ ```
46
+
47
+ Or have them fixed
48
+ ``` bash
49
+ typos --write-changes
50
+ typos -w
51
+ ```
52
+ If there is any ambiguity (multiple possible corrections), ` typos ` will just report it to the user and move on.
53
+
54
+ ### False-positives
55
+
56
+ Sometimes, what looks like a typo is intentional, like with people's names, acronyms, or localized content.
57
+
58
+ To mark an identifier or word as valid, add it your [ ` _typos.toml ` ] ( docs/reference.md ) by declaring itself as the valid spelling:
59
+ ``` toml
60
+ [default .extend-identifiers ]
61
+ # *sigh* this just isn't worth the cost of fixing
62
+ AttributeIDSupressMenu = " AttributeIDSupressMenu"
63
+
64
+ [default .extend-words ]
65
+ # Don't correct the surname "Teh"
66
+ teh = " teh"
67
+ ```
68
+
69
+ For localized content, you might want to exclude the entire file
70
+ ``` toml
71
+ [files ]
72
+ extend-exclude = [" localized/*.po" ]
73
+ ```
74
+
75
+ ### Integrations
76
+
77
+ ` typos ` provides several building blocks for custom integrations
78
+ - ` - ` reads from ` stdin ` , ` --write-changes ` will be written to ` stdout `
79
+ - ` --diff ` to provide a diff
80
+ - ` --format json ` to get jsonlines with exit code 0 on no errors, code 2 on typos, anything else is an error.
81
+
82
+ Examples:
83
+ ``` bash
84
+ # Read file from stdin, write corrected version to stdout
85
+ typos - --write-changes
86
+ # Creates a diff of what would change
87
+ typos dir/file --diff
88
+ # Fully programmatic control
89
+ typos dir/file --format json
90
+ ```
91
+
39
92
[ Crates.io ] : https://crates.io/crates/typos-cli
40
93
[ Documentation ] : https://docs.rs/typos
0 commit comments