1# Config for the `typos` crate, used by `./x test tidy --extra-checks=spellcheck`.
2# See also: https://github.com/crate-ci/typos/blob/v1.28.2/docs/reference.md
3
4[files]
5extend-exclude = [
6 # exclude git (sub)modules and generated content
7 "compiler/rustc_baked_icu_data",
8 "compiler/rustc_codegen_cranelift",
9 "compiler/rustc_codegen_gcc",
10 "library/backtrace",
11 "library/compiler-builtins",
12 "library/stdarch",
13 # generated lorem ipsum texts
14 "library/alloctests/benches/str.rs",
15 "library/alloctests/tests/str.rs",
16]
17
18[default.extend-words]
19# Allowlist for words that look like typos but are not, or aren't worth fixing
20# right now. Entries should look like `mipsel = "mipsel"`.
21#
22# tidy-alphabetical-start
23anser = "anser" # an ANSI parsing package used by rust-analyzer
24arange = "arange" # short for A-range
25childs = "childs"
26clonable = "clonable"
27filetimes = "filetimes" # short for "file times", not a typo for "lifetimes"
28leafs = "leafs"
29makro = "makro" # deliberate misspelling to avoid `macro` keyword
30misformed = "misformed"
31moreso = "moreso"
32numer = "numer" # short for numerator, not a typo for "number"
33old-skool = "old-skool" # variant spelling of "old-school"
34optin = "optin" # short for opt-in
35publically = "publically"
36rplace = "rplace" # short for R-place
37splitted = "splitted"
38sythetic = "sythetic" # typo in vendored LLVM sources
39taits = "taits" # lowercase for TAITs (type alias impl trait)
40targetting = "targetting"
41unparseable = "unparseable"
42unstability = "unstability"
43unstalled = "unstalled" # short for un-stalled
44# tidy-alphabetical-end
45
46# Denylist to forbid misspelled words that aren't detected by the built-in
47# dictionary. Entries should look like `mipsel = ""` or `mipsel = "misspell"`;
48# the non-empty form can be automatically fixed by `--bless`.
49#
50# tidy-alphabetical-start
51atomicaly = "atomically"
52definitinon = "definition"
53dependy = ""
54similarlty = "similarity"
55# tidy-alphabetical-end
56
57[default.extend-identifiers]
58# Allowlist for specific identifiers that should be permitted even though they
59# appear to contain typos that would be forbidden in other identifiers.
60#
61# For example, you might want to allow a specific constant like
62# `DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME`, but still want to forbid
63# the typo `INVAILD` in other places.
64#
65# tidy-alphabetical-start
66DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME = "DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME"
67ERRNO_ACCES = "ERRNO_ACCES"
68ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS = "ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS"
69ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC = "ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC"
70ERROR_FILENAME_EXCED_RANGE = "ERROR_FILENAME_EXCED_RANGE"
71ERROR_MCA_OCCURED = "ERROR_MCA_OCCURED"
72ERROR_REQ_NOT_ACCEP = "ERROR_REQ_NOT_ACCEP"
73EnzymeTypeTreeShiftIndiciesEq = "EnzymeTypeTreeShiftIndiciesEq"
74EnzymeTypeTreeShiftIndiciesEqFn = "EnzymeTypeTreeShiftIndiciesEqFn"
75Oppen = "Oppen" # Derek C. Oppen, author of "Pretty Printing" (1979)
76# typos treats this as two different camelcase words (`SETTIN` and `Gs`)
77# Tracked in: https://github.com/crate-ci/typos/issues/745
78SETTINGs = "SETTINGs"
79debug_aranges = "debug_aranges" # debug A-ranges
80key_smove = "key_smove" # shifted move key, used by terminfo
81shift_indicies_eq = "shift_indicies_eq"
82tolen = "tolen" # length of "to" buffer, used by `sendto` in Windows sockets
83# tidy-alphabetical-end
84
85[default]
86extend-ignore-words-re = [
87 # words with length <= 4 chars is likely noise
88 "^[a-zA-Z]{1,4}$",
89]
90
91extend-ignore-re = [
92 # allow turning off spell checking
93 "(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
94 # ignore these intentional typo examples
95 "/// 1 \\| #\\[cfg\\(widnows\\)\\]",
96 "/// warning: unexpected `cfg` condition name: `widnows`",
97 "/// #\\[cfg\\(widnows\\)\\]",
98 "\\.arg\\(\"Oh no, a tpyo!\"\\)",
99 # string used in benches
100 "\"core::iter::adapters::Copie\"",
101 "-Ccontrol-flow-guard",
102 "concat!\\(\"CURRENT_RUSTC_VERSIO\", \"N\"\\)",
103 "\\*\\*v\\*\\*ariable",
104]