Fix typos by codespell (#7600)

# Description

Found via `codespell -S target -L
crate,ser,numer,falsy,ro,te,nd,bu,ndoes,statics,ons,fo,rouge,pard`

# User-Facing Changes

None.

# Tests + Formatting

None and done.

# After Submitting

None.
This commit is contained in:
Kian-Meng Ang
2022-12-26 15:31:26 +08:00
committed by GitHub
parent 2415381682
commit 79000aa5e0
39 changed files with 61 additions and 61 deletions

View File

@ -40,7 +40,7 @@ fn parse_range(range: Value, head: Span) -> Result<(isize, isize, Span), ShellEr
let end = match end {
Value::Int { val, .. } => val.to_string(),
Value::String { val, .. } => val,
// Explictly propagate errors instead of dropping them.
// Explicitly propagate errors instead of dropping them.
Value::Error { error } => return Err(error),
other => {
return Err(ShellError::UnsupportedInput(
@ -55,7 +55,7 @@ fn parse_range(range: Value, head: Span) -> Result<(isize, isize, Span), ShellEr
let start = match start {
Value::Int { val, .. } => val.to_string(),
Value::String { val, .. } => val,
// Explictly propagate errors instead of dropping them.
// Explicitly propagate errors instead of dropping them.
Value::Error { error } => return Err(error),
other => {
return Err(ShellError::UnsupportedInput(
@ -83,7 +83,7 @@ fn parse_range(range: Value, head: Span) -> Result<(isize, isize, Span), ShellEr
}
}
}
// Explictly propagate errors instead of dropping them.
// Explicitly propagate errors instead of dropping them.
Value::Error { error } => return Err(error),
other => {
return Err(ShellError::UnsupportedInput(

View File

@ -52,7 +52,7 @@ impl Command for BytesBuild {
let val = eval_expression(engine_state, stack, expr)?;
match val {
Value::Binary { mut val, .. } => output.append(&mut val),
// Explictly propagate errors instead of dropping them.
// Explicitly propagate errors instead of dropping them.
Value::Error { error } => return Err(error),
other => {
return Err(ShellError::TypeMismatch(

View File

@ -54,7 +54,7 @@ impl Command for BytesCollect {
output_binary.append(&mut work_sep)
}
}
// Explictly propagate errors instead of dropping them.
// Explicitly propagate errors instead of dropping them.
Value::Error { error } => return Err(error),
other => {
return Err(ShellError::OnlySupportsThisInputType(

View File

@ -193,7 +193,7 @@ fn remove_impl(input: &[u8], arg: &Arguments, span: Span) -> Value {
right += 1;
}
}
// append the remaing thing to result, this can happened when
// append the remaining thing to result, this can happened when
// we have something to remove and remove_all is False.
let mut remain = input[left..].to_vec();
result.append(&mut remain);

View File

@ -78,7 +78,7 @@ impl HashableValue {
Value::String { val, span } => Ok(HashableValue::String { val, span }),
Value::Binary { val, span } => Ok(HashableValue::Binary { val, span }),
// Explictly propagate errors instead of dropping them.
// Explicitly propagate errors instead of dropping them.
Value::Error { error } => Err(error),
_ => Err(ShellError::UnsupportedInput(
"input value is not hashable".into(),

View File

@ -86,7 +86,7 @@ fn command(
let series = df.as_series(call.head)?;
let chunked = series.utf8().map_err(|e| {
ShellError::GenericError(
"Error convertion to string".into(),
"Error conversion to string".into(),
e.to_string(),
Some(call.head),
None,

View File

@ -86,7 +86,7 @@ fn command(
let series = df.as_series(call.head)?;
let chunked = series.utf8().map_err(|e| {
ShellError::GenericError(
"Error convertion to string".into(),
"Error conversion to string".into(),
e.to_string(),
Some(call.head),
None,

View File

@ -126,7 +126,7 @@ impl NuExpression {
expr_to_value(self.as_ref(), span)
}
// Convenient function to extrac multiple Expr that could be inside a nushell Value
// Convenient function to extract multiple Expr that could be inside a nushell Value
pub fn extract_exprs(value: Value) -> Result<Vec<Expr>, ShellError> {
ExtractedExpr::extract_exprs(value).map(ExtractedExpr::into_exprs)
}

View File

@ -8,7 +8,7 @@ use nu_protocol::{
};
use std::path::Path;
// when the file under the fold executeable
// when the file under the fold executable
#[cfg(unix)]
mod permission_mods {
pub type Mode = u32;

View File

@ -25,7 +25,7 @@ struct Finding {
congruence: Vec<Congruence>,
}
/// Returns an interator over directory's children matching the abbreviation.
/// Returns an iterator over directory's children matching the abbreviation.
fn get_matching_children<'a, P>(
path: &'a P,
abbr: &'a Abbr,

View File

@ -514,7 +514,7 @@ fn to_nu_ansi_term_style(style: &LsColors_Style) -> Style {
LsColors_Color::White => Color::White,
// Below items are a rough translations to 256 colors as
// nu-ansi-term do not have bright varients
// nu-ansi-term do not have bright variants
LsColors_Color::BrightBlack => Color::Fixed(8),
LsColors_Color::BrightRed => Color::Fixed(9),
LsColors_Color::BrightGreen => Color::Fixed(10),

View File

@ -5,7 +5,7 @@ use nu_protocol::{
Signature, Span, Type, Value,
};
use once_cell::sync::Lazy;
// regex can be replaced with fancy-regex once it suppports `split()`
// regex can be replaced with fancy-regex once it supports `split()`
// https://github.com/fancy-regex/fancy-regex/issues/104
use regex::Regex;

View File

@ -154,7 +154,7 @@ static CODE_LIST: Lazy<Vec<AnsiCode>> = Lazy::new(|| { vec![
AnsiCode{ short_name: Some("defr"), long_name: "default_reverse", code: Color::Default.reverse().prefix().to_string()},
AnsiCode{ short_name: Some("bg_def"), long_name: "bg_default", code: Style::new().on(Color::Default).prefix().to_string()},
// Xterm 256 colors with conflicting names names preceeded by x
// Xterm 256 colors with conflicting names names preceded by x
AnsiCode { short_name: Some("xblack"), long_name: "xterm_black", code: Color::Fixed(0).prefix().to_string()},
AnsiCode { short_name: Some("maroon"), long_name: "xterm_maroon", code: Color::Fixed(1).prefix().to_string()},
AnsiCode { short_name: Some("xgreen"), long_name: "xterm_green", code: Color::Fixed(2).prefix().to_string()},

View File

@ -192,7 +192,7 @@ fn action(
Value::string(gradient_string, *span)
}
(None, Some(fg_end), None, Some(bg_end)) => {
// missin fg_start and bg_start, so assume black
// missing fg_start and bg_start, so assume black
let fg_start = Rgb::new(0, 0, 0);
let bg_start = Rgb::new(0, 0, 0);
let fg_gradient = Gradient::new(fg_start, fg_end);

View File

@ -124,18 +124,18 @@ impl Command for SubCommand {
result: Some(Value::test_string("dogs_$2_cats")),
},
Example {
description: "Find and replace the first occurence using string replacement *not* regular expressions",
description: "Find and replace the first occurrence using string replacement *not* regular expressions",
example: r#"'c:\some\cool\path' | str replace 'c:\some\cool' '~' -s"#,
result: Some(Value::test_string("~\\path")),
},
Example {
description: "Find and replace all occurences using string replacement *not* regular expressions",
description: "Find and replace all occurrences using string replacement *not* regular expressions",
example: r#"'abc abc abc' | str replace -a 'b' 'z' -s"#,
result: Some(Value::test_string("azc azc azc")),
},
Example {
description: "Find and replace with fancy-regex",
example: r#"'a sucessful b' | str replace '\b([sS])uc(?:cs|s?)e(ed(?:ed|ing|s?)|ss(?:es|ful(?:ly)?|i(?:ons?|ve(?:ly)?)|ors?)?)\b' '${1}ucce$2'"#,
example: r#"'a successful b' | str replace '\b([sS])uc(?:cs|s?)e(ed(?:ed|ing|s?)|ss(?:es|ful(?:ly)?|i(?:ons?|ve(?:ly)?)|ors?)?)\b' '${1}ucce$2'"#,
result: Some(Value::test_string("a successful b")),
},
Example {

View File

@ -272,7 +272,7 @@ fn trim(s: &str, char_: Option<char>, closure_flags: &ClosureFlags) -> String {
let re_str = format!("{}{{2,}}", reg);
// create the regex
let re = Regex::new(&re_str).expect("Error creating regular expression");
// replace all mutliple occurances with single occurences represented by r
// replace all multiple occurrences with single occurrences represented by r
let new_str = re.replace_all(&return_string, r.to_string());
// update the return string so the next loop has the latest changes
return_string = new_str.to_string();

View File

@ -86,12 +86,12 @@ impl Command for Table {
.named(
"flatten-separator",
SyntaxShape::String,
"sets a seperator when 'flatten' used",
"sets a separator when 'flatten' used",
None,
)
.switch(
"collapse",
"expand the table structure in colapse mode.\nBe aware collapse mode currently doesn't support width controll",
"expand the table structure in colapse mode.\nBe aware collapse mode currently doesn't support width control",
Some('c'),
)
.category(Category::Viewers)
@ -497,7 +497,7 @@ fn build_expanded_table(
match table {
Some((mut table, with_header, with_index)) => {
// controll width via removing table columns.
// control width via removing table columns.
table.truncate(remaining_width, &theme);
is_expanded = true;