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): Add Julia-specific dictionary #856

Merged
merged 5 commits into from
Oct 17, 2023
Merged
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
3 changes: 1 addition & 2 deletions crates/typos-cli/src/default_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
("js", &["*.js", "*.jsx", "*.vue"]),
("json", &["*.json"]),
("jsonl", &["*.jsonl"]),
("julia", &["*.jl"]),
epage marked this conversation as resolved.
Show resolved Hide resolved
("jupyter", &["*.ipynb", "*.jpynb"]),
("k", &["*.k"]),
("kotlin", &["*.kt", "*.kts"]),
Expand Down Expand Up @@ -145,7 +144,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
"OFL-*[0-9]*",
]),
("lilypond", &["*.ly", "*.ily"]),
("lisp", &["*.el", "*.jl", "*.lisp", "*.lsp", "*.sc", "*.scm"]),
("lisp", &["*.el", "*.lisp", "*.lsp", "*.sc", "*.scm"]),
epage marked this conversation as resolved.
Show resolved Hide resolved
("lock", &["*.lock", "package-lock.json", "requirements.txt", "go.sum", "pnpm-lock.yaml"]),
("log", &["*.log"]),
("lua", &["*.lua"]),
Expand Down
12 changes: 12 additions & 0 deletions crates/typos-cli/src/file_type_specifics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ pub const TYPE_SPECIFIC_DICTS: &[(&str, StaticDictConfig)] = &[
ignore_words: &[],
},
),
(
"jl",
StaticDictConfig {
ignore_idents: &[],
ignore_words: &[
"egal", // name for `===` operator
"egals", // name for `===` operator
"modul", // stand-in for `module` when needing to avoid the keyword
"usig", // stand-in for `using` when needing to avoid the keyword
],
},
),
(
"man",
StaticDictConfig {
Expand Down
2 changes: 2 additions & 0 deletions crates/typos-cli/tests/cmd/false-positives.in/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ git glossary has both commitish and committish, so don't correct them
HTTP_REFERER is a valid HTTP header field

It should be reasonable to talk about `<thead>`

SHTTP is a protocol
6 changes: 6 additions & 0 deletions crates/typos-cli/tests/cmd/false-positives.in/sample.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# one egal: ===
# three egals: === === ===

# When we need to refer to keywords without saying them
var modul = "hello";
var usig = "hello";
1 change: 1 addition & 0 deletions crates/typos-dict/assets/allowed.csv
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ contiguities,plural of contiguity
bellow,valid word and not just a typo of `below`
revered,valid word and not just a typoe of `reversed`
recuse,valid word despite maybe being a typo of recurse
shttp,also a protocol
1 change: 0 additions & 1 deletion crates/typos-dict/assets/words.csv
Original file line number Diff line number Diff line change
Expand Up @@ -52334,7 +52334,6 @@ shtopped,stopped,shopped
shtoppes,stops,shops
shtopping,stopping,shopping
shtops,stops,shops
shttp,https
shudown,shutdown
shufle,shuffle
shuld,should
Expand Down
2 changes: 0 additions & 2 deletions crates/typos-dict/src/word_codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37383,7 +37383,6 @@ pub static WORD_SHT_CHILDREN: dictgen::DictTable<&'static [&'static str]> = dict
dictgen::InsensitiveStr::Ascii("oppes"),
dictgen::InsensitiveStr::Ascii("opping"),
dictgen::InsensitiveStr::Ascii("ops"),
dictgen::InsensitiveStr::Ascii("tp"),
],
values: &[
&["shitless"],
Expand All @@ -37396,7 +37395,6 @@ pub static WORD_SHT_CHILDREN: dictgen::DictTable<&'static [&'static str]> = dict
&["stops", "shops"],
&["stopping", "shopping"],
&["stops", "shops"],
&["https"],
],
range: 2..=6,
};
Expand Down
Loading