Skip to content

Commit

Permalink
Merge pull request #856 from epage/julia
Browse files Browse the repository at this point in the history
fix(dict): Add Julia-specific dictionary
  • Loading branch information
epage committed Oct 17, 2023
2 parents bb22d73 + b268587 commit 0d5e460
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
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"]),
("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"]),
("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

0 comments on commit 0d5e460

Please sign in to comment.