mirror of
https://github.com/nushell/nushell.git
synced 2024-11-24 17:34:00 +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 } => {
|
Value::String { val, span } => {
|
||||||
let splitted_result = val.split_once(',');
|
let split_result = val.split_once(',');
|
||||||
match splitted_result {
|
match split_result {
|
||||||
Some((start, end)) => (start.to_string(), end.to_string(), span),
|
Some((start, end)) => (start.to_string(), end.to_string(), span),
|
||||||
None => {
|
None => {
|
||||||
return Err(ShellError::UnsupportedInput(
|
return Err(ShellError::UnsupportedInput(
|
||||||
|
@ -21,7 +21,7 @@ impl Command for SplitBy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn usage(&self) -> &str {
|
fn usage(&self) -> &str {
|
||||||
"Create a new table splitted."
|
"Create a new table split."
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
|
@ -190,7 +190,7 @@ impl UrlComponents {
|
|||||||
|
|
||||||
if let Some(q) = self.query {
|
if let Some(q) = self.query {
|
||||||
if q != qs {
|
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 {
|
return Err(ShellError::IncompatibleParameters {
|
||||||
left_message: format!("Mismatch, qs from params is: {}", qs),
|
left_message: format!("Mismatch, qs from params is: {}", qs),
|
||||||
left_span: value.expect_span(),
|
left_span: value.expect_span(),
|
||||||
@ -248,7 +248,7 @@ impl UrlComponents {
|
|||||||
"query" => {
|
"query" => {
|
||||||
if let Some(q) = self.query {
|
if let Some(q) = self.query {
|
||||||
if q != s {
|
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 {
|
return Err(ShellError::IncompatibleParameters {
|
||||||
left_message: format!("Mismatch, query param is: {}", s),
|
left_message: format!("Mismatch, query param is: {}", s),
|
||||||
left_span: value.expect_span(),
|
left_span: value.expect_span(),
|
||||||
|
@ -23,7 +23,7 @@ use nu_protocol::{ast::Call, ShellError};
|
|||||||
pub fn grapheme_flags(call: &Call) -> Result<bool, ShellError> {
|
pub fn grapheme_flags(call: &Call) -> Result<bool, ShellError> {
|
||||||
let g_flag = call.has_flag("grapheme-clusters");
|
let g_flag = call.has_flag("grapheme-clusters");
|
||||||
// Check for the other flags and produce errors if they exist.
|
// 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.
|
// 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") {
|
if g_flag && call.has_flag("utf-8-bytes") {
|
||||||
Err(ShellError::IncompatibleParametersSingle(
|
Err(ShellError::IncompatibleParametersSingle(
|
||||||
|
Loading…
Reference in New Issue
Block a user