mirror of
https://github.com/nushell/nushell.git
synced 2025-06-29 22:28:35 +02:00
Minimize future false positive typos (#12751)
# Description
Make typos config more strict: ignore false positives where they occur.
1. Ignore only files with typos
2. Add regexp-s with context
3. Ignore variable names only in Rust code
4. Ignore only 1 "identifier"
5. Check dot files
🎁 Extra bonus: fix typos!!
This commit is contained in:
@ -8,7 +8,7 @@ pub(crate) fn parse_date_from_string(
|
||||
match dtparse::parse(input) {
|
||||
Ok((native_dt, fixed_offset)) => {
|
||||
let offset = match fixed_offset {
|
||||
Some(fo) => fo,
|
||||
Some(offset) => offset,
|
||||
None => *(Local::now().offset()),
|
||||
};
|
||||
match offset.from_local_datetime(&native_dt) {
|
||||
|
@ -2562,12 +2562,12 @@ fn create_theme_output(theme: &str) -> Vec<String> {
|
||||
}
|
||||
|
||||
fn theme_cmd(theme: &str, footer: bool, then: &str) -> String {
|
||||
let mut with_foorter = String::new();
|
||||
let mut with_footer = String::new();
|
||||
if footer {
|
||||
with_foorter = "$env.config.footer_mode = \"always\"".to_string();
|
||||
with_footer = "$env.config.footer_mode = \"always\"".to_string();
|
||||
}
|
||||
|
||||
format!("$env.config.table.mode = {theme}; $env.config.table.header_on_separator = true; {with_foorter}; {then}")
|
||||
format!("$env.config.table.mode = {theme}; $env.config.table.header_on_separator = true; {with_footer}; {then}")
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -260,8 +260,8 @@ where
|
||||
}
|
||||
_ => {
|
||||
if chf == b'-' || chf.is_ascii_digit() {
|
||||
let mut pn = ParseNumber::new(self.str_buf.iter().copied());
|
||||
match pn.parse(false) {
|
||||
let mut parser = ParseNumber::new(self.str_buf.iter().copied());
|
||||
match parser.parse(false) {
|
||||
Ok(Number::F64(v)) => {
|
||||
self.rdr.uneat_char(ch);
|
||||
return visitor.visit_f64(v);
|
||||
|
@ -13,7 +13,7 @@ You'll generally find the team members on
|
||||
[Discord `#standard-library` channel][discord#standard-library] and can have
|
||||
preliminary discussions there to clarify the issues involved.
|
||||
|
||||
You can open a [Github issue][new-issue] to have a more focused discussion of
|
||||
You can open a [GitHub issue][new-issue] to have a more focused discussion of
|
||||
your idea.
|
||||
|
||||
Generally, we think the standard library should contain items that are relevant
|
||||
|
Reference in New Issue
Block a user