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