mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
Add Github Actions workflow to check for typos (#7892)
- Add Github Actions workflow to check typos - Fix existing typos
This commit is contained in:
parent
1f810cd26a
commit
8787ec9fe8
13
.github/workflows/typos.yml
vendored
Normal file
13
.github/workflows/typos.yml
vendored
Normal file
@ -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
|
12
.typos.toml
Normal file
12
.typos.toml
Normal file
@ -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"
|
@ -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(
|
||||
|
@ -21,7 +21,7 @@ impl Command for SplitBy {
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
"Create a new table splitted."
|
||||
"Create a new table split."
|
||||
}
|
||||
|
||||
fn run(
|
||||
|
@ -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(),
|
||||
|
@ -23,7 +23,7 @@ use nu_protocol::{ast::Call, ShellError};
|
||||
pub fn grapheme_flags(call: &Call) -> Result<bool, ShellError> {
|
||||
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(
|
||||
|
Loading…
Reference in New Issue
Block a user