diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 000000000..803deae23 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,13 @@ +name: Typos +on: [pull_request] + +jobs: + run: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v2 + + - name: Check spelling of book + uses: crate-ci/typos@master diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 000000000..7274f5c95 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,12 @@ +[files] +extend-exclude = ["crates/nu-command/tests/commands/table.rs", "*.tsv", "*.json", "*.txt"] + +[default.extend-words] +# Ignore false-positives +nd = "nd" +fo = "fo" +ons = "ons" +ba = "ba" +Plasticos = "Plasticos" +IIF = "IIF" +numer = "numer" diff --git a/crates/nu-command/src/bytes/at.rs b/crates/nu-command/src/bytes/at.rs index 7ce52b288..3aa044cfb 100644 --- a/crates/nu-command/src/bytes/at.rs +++ b/crates/nu-command/src/bytes/at.rs @@ -70,8 +70,8 @@ fn parse_range(range: Value, head: Span) -> Result<(isize, isize, Span), ShellEr } } Value::String { val, span } => { - let splitted_result = val.split_once(','); - match splitted_result { + let split_result = val.split_once(','); + match split_result { Some((start, end)) => (start.to_string(), end.to_string(), span), None => { return Err(ShellError::UnsupportedInput( diff --git a/crates/nu-command/src/filters/split_by.rs b/crates/nu-command/src/filters/split_by.rs index 845352d7e..6991d28de 100644 --- a/crates/nu-command/src/filters/split_by.rs +++ b/crates/nu-command/src/filters/split_by.rs @@ -21,7 +21,7 @@ impl Command for SplitBy { } fn usage(&self) -> &str { - "Create a new table splitted." + "Create a new table split." } fn run( diff --git a/crates/nu-command/src/network/url/join.rs b/crates/nu-command/src/network/url/join.rs index d2c3e2bde..af3de1487 100644 --- a/crates/nu-command/src/network/url/join.rs +++ b/crates/nu-command/src/network/url/join.rs @@ -190,7 +190,7 @@ impl UrlComponents { if let Some(q) = self.query { if q != qs { - // if query is present it means that also query_span is setted. + // if query is present it means that also query_span is set. return Err(ShellError::IncompatibleParameters { left_message: format!("Mismatch, qs from params is: {}", qs), left_span: value.expect_span(), @@ -248,7 +248,7 @@ impl UrlComponents { "query" => { if let Some(q) = self.query { if q != s { - // if query is present it means that also params_span is setted. + // if query is present it means that also params_span is set. return Err(ShellError::IncompatibleParameters { left_message: format!("Mismatch, query param is: {}", s), left_span: value.expect_span(), diff --git a/crates/nu-command/src/strings/mod.rs b/crates/nu-command/src/strings/mod.rs index 86e5e61c2..10e59ab9d 100644 --- a/crates/nu-command/src/strings/mod.rs +++ b/crates/nu-command/src/strings/mod.rs @@ -23,7 +23,7 @@ use nu_protocol::{ast::Call, ShellError}; pub fn grapheme_flags(call: &Call) -> Result { let g_flag = call.has_flag("grapheme-clusters"); // Check for the other flags and produce errors if they exist. - // Note that Nushell already prevents nonexistant flags from being used with commands, + // Note that Nushell already prevents nonexistent flags from being used with commands, // so this function can be reused for both the --utf-8-bytes commands and the --code-points commands. if g_flag && call.has_flag("utf-8-bytes") { Err(ShellError::IncompatibleParametersSingle(