Skip to content

Commit a67e345

Browse files
authored
Rollup merge of #151804 - Zalathar:sort-typos, r=lqd
Document, sort, and tweak spellcheck entries in `typos.toml` - This grew out of #151781, which was originally a simple typo fix.
2 parents 4d7db90 + a42bbe6 commit a67e345

3 files changed

Lines changed: 41 additions & 28 deletions

File tree

compiler/rustc_resolve/src/build_reduced_graph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
6060
}
6161
}
6262

63-
/// Create a name definitinon from the given components, and put it into the local module.
63+
/// Create a name definition from the given components, and put it into the local module.
6464
fn define_local(
6565
&mut self,
6666
parent: Module<'ra>,
@@ -76,7 +76,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
7676
self.plant_decl_into_local_module(ident, orig_ident.span, ns, decl);
7777
}
7878

79-
/// Create a name definitinon from the given components, and put it into the extern module.
79+
/// Create a name definition from the given components, and put it into the extern module.
8080
fn define_extern(
8181
&self,
8282
parent: Module<'ra>,

src/tools/tidy/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ fn main() {
3232
let npm: PathBuf = env::args_os().nth(5).expect("need name/path of npm command").into();
3333

3434
let root_manifest = root_path.join("Cargo.toml");
35+
let typos_toml = root_path.join("typos.toml");
3536
let src_path = root_path.join("src");
3637
let tests_path = root_path.join("tests");
3738
let library_path = root_path.join("library");
@@ -143,6 +144,7 @@ fn main() {
143144
check!(edition, &library_path);
144145

145146
check!(alphabetical, &root_manifest);
147+
check!(alphabetical, &typos_toml);
146148
check!(alphabetical, &src_path);
147149
check!(alphabetical, &tests_path);
148150
check!(alphabetical, &compiler_path);

typos.toml

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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+
14
[files]
25
extend-exclude = [
36
# exclude git (sub)modules and generated content
@@ -13,57 +16,65 @@ extend-exclude = [
1316
]
1417

1518
[default.extend-words]
16-
# Add exclusions here, lines should be like `x = "x"`, where `x` is excluded word.
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"`.
1721
#
18-
# Also see docs: https://github.com/crate-ci/typos/blob/v1.28.2/docs/reference.md
19-
arange = "arange"
22+
# tidy-alphabetical-start
23+
arange = "arange" # short for A-range
2024
childs = "childs"
2125
clonable = "clonable"
22-
Datas = "Datas"
23-
filetimes = "filetimes"
26+
filetimes = "filetimes" # short for "file times", not a typo for "lifetimes"
2427
leafs = "leafs"
25-
makro = "makro"
28+
makro = "makro" # deliberate misspelling to avoid `macro` keyword
2629
misformed = "misformed"
2730
moreso = "moreso"
28-
optin = "optin"
31+
numer = "numer" # short for numerator, not a typo for "number"
32+
optin = "optin" # short for opt-in
2933
publically = "publically"
30-
rplace = "rplace"
31-
smove = "smove"
34+
rplace = "rplace" # short for R-place
3235
splitted = "splitted"
33-
taits = "taits"
36+
taits = "taits" # lowercase for TAITs (type alias impl trait)
3437
targetting = "targetting"
3538
unparseable = "unparseable"
3639
unstability = "unstability"
37-
unstalled = "unstalled"
38-
numer = "numer"
40+
unstalled = "unstalled" # short for un-stalled
41+
# tidy-alphabetical-end
3942

40-
# this can be valid word, depends on dictionary edition
41-
#matcheable = "matcheable"
43+
# Denylist to forbid misspelled words that aren't detected by the built-in
44+
# dictionary. Entries should look like `mipsel = ""` or `mipsel = "misspell"`;
45+
# the non-empty form can be automatically fixed by `--bless`.
46+
#
47+
# tidy-alphabetical-start
48+
definitinon = "definition"
49+
# tidy-alphabetical-end
4250

4351
[default.extend-identifiers]
44-
# An entry goes here if the typo is part of some existing ident
45-
# where you want to keep it, but don't want to allow
46-
# such typos everywhere.
52+
# Allowlist for specific identifiers that should be permitted even though they
53+
# appear to contain typos that would be forbidden in other identifiers.
54+
#
55+
# For example, you might want to allow a specific constant like
56+
# `DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME`, but still want to forbid
57+
# the typo `INVAILD` in other places.
4758
#
48-
# I.e. you don't want (or can't) fix some constant name, like
49-
# `DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME` but actually
50-
# want to see `INVAILD` typo fixed in other places.
51-
debug_aranges = "debug_aranges"
59+
# tidy-alphabetical-start
5260
DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME = "DNS_ERROR_INVAILD_VIRTUALIZATION_INSTANCE_NAME"
53-
EnzymeTypeTreeShiftIndiciesEq = "EnzymeTypeTreeShiftIndiciesEq"
54-
EnzymeTypeTreeShiftIndiciesEqFn = "EnzymeTypeTreeShiftIndiciesEqFn"
55-
shift_indicies_eq = "shift_indicies_eq"
5661
ERRNO_ACCES = "ERRNO_ACCES"
5762
ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS = "ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS"
5863
ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC = "ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC"
5964
ERROR_FILENAME_EXCED_RANGE = "ERROR_FILENAME_EXCED_RANGE"
6065
ERROR_MCA_OCCURED = "ERROR_MCA_OCCURED"
6166
ERROR_REQ_NOT_ACCEP = "ERROR_REQ_NOT_ACCEP"
62-
Oppen = "Oppen"
67+
EnzymeTypeTreeShiftIndiciesEq = "EnzymeTypeTreeShiftIndiciesEq"
68+
EnzymeTypeTreeShiftIndiciesEqFn = "EnzymeTypeTreeShiftIndiciesEqFn"
69+
Oppen = "Oppen" # Derek C. Oppen, author of "Pretty Printing" (1979)
6370
# typos treats this as two different camelcase words (`SETTIN` and `Gs`)
6471
# Tracked in: https://github.com/crate-ci/typos/issues/745
6572
SETTINGs = "SETTINGs"
66-
tolen = "tolen"
73+
debug_aranges = "debug_aranges" # debug A-ranges
74+
key_smove = "key_smove" # shifted move key, used by terminfo
75+
shift_indicies_eq = "shift_indicies_eq"
76+
tolen = "tolen" # length of "to" buffer, used by `sendto` in Windows sockets
77+
# tidy-alphabetical-end
6778

6879
[default]
6980
extend-ignore-words-re = [

0 commit comments

Comments
 (0)