Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dict): Allow spawnve #796

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions crates/typos-dict/assets/allowed.csv
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
nilable,used in ruby community
thead,html tag
hardlinked,filesystem term
referer,http header field
accreting,verb of accrete
contiguities,plural of contiguity
deques,noun
dequeues,verb
ons,so `add-ons` works
accreting,verb of accrete
zar,currency code for the South African rand
simulative,adjective
pervious,adjective
perviously,adverb
hardlinked,filesystem term
intension,noun
intensional,adjective
intensionally,adverb
nilable,used in ruby community
ons,so `add-ons` works
pervious,adjective
perviously,adverb
referer,http header field
simulative,adjective
spawnve,Microsoft-specific function (see https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnve)
thead,html tag
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming, through bindings, this appears in enough programming languages that this is a generally allowed word, rather than a file-type specific one?

unuseful,adjective
contiguities,plural of contiguity
zar,currency code for the South African rand
1 change: 0 additions & 1 deletion crates/typos-dict/assets/words.csv
Original file line number Diff line number Diff line change
Expand Up @@ -53505,7 +53505,6 @@ spawing,spawning
spawining,spawning
spawnig,spawning
spawnign,spawning
spawnve,spawn
spaws,spawns
spcae,space
spcaed,spaced
Expand Down
2 changes: 0 additions & 2 deletions crates/typos-dict/src/dict_codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33487,7 +33487,6 @@ pub static WORD_SPA_CHILDREN: dictgen::DictTable<&'static [&'static str]> = dict
dictgen::InsensitiveStr::Ascii("wining"),
dictgen::InsensitiveStr::Ascii("wnig"),
dictgen::InsensitiveStr::Ascii("wnign"),
dictgen::InsensitiveStr::Ascii("wnve"),
dictgen::InsensitiveStr::Ascii("ws"),
],
values: &[
Expand Down Expand Up @@ -33542,7 +33541,6 @@ pub static WORD_SPA_CHILDREN: dictgen::DictTable<&'static [&'static str]> = dict
&["spawning"],
&["spawning"],
&["spawning"],
&["spawn"],
&["spawns"],
],
range: 1..=11,
Expand Down
16 changes: 16 additions & 0 deletions crates/typos-dict/tests/verify.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use indexmap::IndexSet;
use itertools::Itertools;
use std::collections::BTreeMap;
use std::collections::HashMap;
use std::collections::HashSet;
Expand Down Expand Up @@ -253,3 +254,18 @@ fn allowed_words() -> std::collections::HashMap<String, String> {
})
.collect()
}

#[test]
fn allowed_csv_entries_are_sorted_and_unique() {
// The order in the csv file does not affect runtime behavior, but we
// still want them to be sorted to make the file more human-readable.
snapbox::assert_eq_path(
"assets/allowed.csv",
allowed_words()
.iter()
.sorted()
.unique()
.map(|(word, reason)| format!("{word},{reason}\n"))
.join(""),
);
}
Loading