Rename some files (#952)

* renamed some files

* clippy

* update tests
This commit is contained in:
Darren Schroeder 2022-02-05 11:35:02 -06:00 committed by GitHub
parent 3eba90232a
commit 2dd32c2b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 63 additions and 62 deletions

View File

@ -1,4 +1,4 @@
mod command; mod date_;
mod format; mod format;
mod humanize; mod humanize;
mod list_timezone; mod list_timezone;
@ -8,7 +8,7 @@ mod to_table;
mod to_timezone; mod to_timezone;
mod utils; mod utils;
pub use command::Date; pub use date_::Date;
pub use format::SubCommand as DateFormat; pub use format::SubCommand as DateFormat;
pub use humanize::SubCommand as DateHumanize; pub use humanize::SubCommand as DateHumanize;
pub use list_timezone::SubCommand as DateListTimezones; pub use list_timezone::SubCommand as DateListTimezones;

View File

@ -188,12 +188,12 @@ pub fn create_default_context(cwd: impl AsRef<Path>) -> EngineState {
AnsiGradient, AnsiGradient,
AnsiStrip, AnsiStrip,
Clear, Clear,
DefaultKeybindings, KeybindingsDefault,
Input, Input,
InputKeys, KeybindingsListen,
Keybindings, Keybindings,
Kill, Kill,
ListKeybindings, KeybindingsList,
Sleep, Sleep,
TermSize, TermSize,
}; };

View File

@ -97,7 +97,7 @@ impl Command for Drop {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use super::*; use crate::Drop;
#[test] #[test]
fn test_examples() { fn test_examples() {

View File

@ -1,7 +1,7 @@
pub mod column; pub mod column;
pub mod command; pub mod drop_;
pub mod nth; pub mod nth;
pub use column::DropColumn; pub use column::DropColumn;
pub use command::Drop; pub use drop_::Drop;
pub use nth::DropNth; pub use nth::DropNth;

View File

@ -89,7 +89,7 @@ impl Command for Keep {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use crate::Keep;
#[test] #[test]
fn test_examples() { fn test_examples() {

View File

@ -76,7 +76,7 @@ impl Command for KeepUntil {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use crate::KeepUntil;
#[test] #[test]
fn test_examples() { fn test_examples() {

View File

@ -76,7 +76,7 @@ impl Command for KeepWhile {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use crate::KeepWhile;
#[test] #[test]
fn test_examples() { fn test_examples() {

View File

@ -1,7 +1,7 @@
mod command; mod keep_;
mod until; mod keep_until;
mod while_; mod keep_while;
pub use command::Keep; pub use keep_::Keep;
pub use until::KeepUntil; pub use keep_until::KeepUntil;
pub use while_::KeepWhile; pub use keep_while::KeepWhile;

View File

@ -1,7 +1,7 @@
mod command; mod skip_;
mod until; mod skip_until;
mod while_; mod skip_while;
pub use command::Skip; pub use skip_::Skip;
pub use until::SkipUntil; pub use skip_until::SkipUntil;
pub use while_::SkipWhile; pub use skip_while::SkipWhile;

View File

@ -80,7 +80,7 @@ impl Command for Skip {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use crate::Skip;
#[test] #[test]
fn test_examples() { fn test_examples() {

View File

@ -75,7 +75,7 @@ impl Command for SkipUntil {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use crate::SkipUntil;
#[test] #[test]
fn test_examples() { fn test_examples() {

View File

@ -75,7 +75,7 @@ impl Command for SkipWhile {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use crate::SkipWhile;
#[test] #[test]
fn test_examples() { fn test_examples() {

View File

@ -1,10 +1,10 @@
mod base64; mod base64;
mod command;
mod generic_digest; mod generic_digest;
mod hash_;
mod md5; mod md5;
mod sha256; mod sha256;
pub use self::base64::Base64; pub use self::base64::Base64;
pub use self::command::Hash; pub use self::hash_::Hash;
pub use self::md5::HashMd5; pub use self::md5::HashMd5;
pub use self::sha256::HashSha256; pub use self::sha256::HashSha256;

View File

@ -1,9 +1,9 @@
mod abs; mod abs;
mod avg; mod avg;
mod ceil; mod ceil;
pub mod command;
mod eval; mod eval;
mod floor; mod floor;
pub mod math_;
mod max; mod max;
mod median; mod median;
mod min; mod min;
@ -20,9 +20,9 @@ mod variance;
pub use abs::SubCommand as MathAbs; pub use abs::SubCommand as MathAbs;
pub use avg::SubCommand as MathAvg; pub use avg::SubCommand as MathAvg;
pub use ceil::SubCommand as MathCeil; pub use ceil::SubCommand as MathCeil;
pub use command::MathCommand as Math;
pub use eval::SubCommand as MathEval; pub use eval::SubCommand as MathEval;
pub use floor::SubCommand as MathFloor; pub use floor::SubCommand as MathFloor;
pub use math_::MathCommand as Math;
pub use max::SubCommand as MathMax; pub use max::SubCommand as MathMax;
pub use median::SubCommand as MathMedian; pub use median::SubCommand as MathMedian;
pub use min::SubCommand as MathMin; pub use min::SubCommand as MathMin;

View File

@ -1,8 +1,8 @@
mod command;
mod host; mod host;
mod path; mod path;
mod query; mod query;
mod scheme; mod scheme;
mod url_;
use nu_engine::CallExt; use nu_engine::CallExt;
use nu_protocol::{ use nu_protocol::{
@ -16,7 +16,7 @@ pub use self::host::SubCommand as UrlHost;
pub use self::path::SubCommand as UrlPath; pub use self::path::SubCommand as UrlPath;
pub use self::query::SubCommand as UrlQuery; pub use self::query::SubCommand as UrlQuery;
pub use self::scheme::SubCommand as UrlScheme; pub use self::scheme::SubCommand as UrlScheme;
pub use command::Url; pub use url_::Url;
fn handle_value<F>(action: &F, v: &Value, span: Span) -> Value fn handle_value<F>(action: &F, v: &Value, span: Span) -> Value
where where

View File

@ -1,10 +1,10 @@
mod basename; mod basename;
pub mod command;
mod dirname; mod dirname;
mod exists; mod exists;
mod expand; mod expand;
mod join; mod join;
mod parse; mod parse;
pub mod path_;
mod relative_to; mod relative_to;
mod split; mod split;
mod r#type; mod r#type;
@ -12,12 +12,12 @@ mod r#type;
use std::path::Path as StdPath; use std::path::Path as StdPath;
pub use basename::SubCommand as PathBasename; pub use basename::SubCommand as PathBasename;
pub use command::PathCommand as Path;
pub use dirname::SubCommand as PathDirname; pub use dirname::SubCommand as PathDirname;
pub use exists::SubCommand as PathExists; pub use exists::SubCommand as PathExists;
pub use expand::SubCommand as PathExpand; pub use expand::SubCommand as PathExpand;
pub use join::SubCommand as PathJoin; pub use join::SubCommand as PathJoin;
pub use parse::SubCommand as PathParse; pub use parse::SubCommand as PathParse;
pub use path_::PathCommand as Path;
pub use r#type::SubCommand as PathType; pub use r#type::SubCommand as PathType;
pub use relative_to::SubCommand as PathRelativeTo; pub use relative_to::SubCommand as PathRelativeTo;
pub use split::SubCommand as PathSplit; pub use split::SubCommand as PathSplit;

View File

@ -445,7 +445,7 @@ fn build_ansi_hashmap(v: &'static [AnsiCode]) -> HashMap<&'static str, &'static
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::AnsiCommand; use crate::platform::ansi::ansi_::AnsiCommand;
#[test] #[test]
fn examples_work_as_expected() { fn examples_work_as_expected() {

View File

@ -1,7 +1,7 @@
mod command; mod ansi_;
mod gradient; mod gradient;
mod strip; mod strip;
pub use command::AnsiCommand as Ansi; pub use ansi_::AnsiCommand as Ansi;
pub use gradient::SubCommand as AnsiGradient; pub use gradient::SubCommand as AnsiGradient;
pub use strip::SubCommand as AnsiStrip; pub use strip::SubCommand as AnsiStrip;

View File

@ -14,6 +14,6 @@ pub use dir_info::{DirBuilder, DirInfo, FileInfo};
pub use du::Du; pub use du::Du;
pub use input::Input; pub use input::Input;
pub use kill::Kill; pub use kill::Kill;
pub use reedline_commands::{DefaultKeybindings, InputKeys, Keybindings, ListKeybindings}; pub use reedline_commands::{Keybindings, KeybindingsDefault, KeybindingsList, KeybindingsListen};
pub use sleep::Sleep; pub use sleep::Sleep;
pub use term_size::TermSize; pub use term_size::TermSize;

View File

@ -6,9 +6,9 @@ use nu_protocol::{
use reedline::get_reedline_default_keybindings; use reedline::get_reedline_default_keybindings;
#[derive(Clone)] #[derive(Clone)]
pub struct DefaultKeybindings; pub struct KeybindingsDefault;
impl Command for DefaultKeybindings { impl Command for KeybindingsDefault {
fn name(&self) -> &str { fn name(&self) -> &str {
"keybindings default" "keybindings default"
} }

View File

@ -9,9 +9,9 @@ use reedline::{
}; };
#[derive(Clone)] #[derive(Clone)]
pub struct ListKeybindings; pub struct KeybindingsList;
impl Command for ListKeybindings { impl Command for KeybindingsList {
fn name(&self) -> &str { fn name(&self) -> &str {
"keybindings list" "keybindings list"
} }

View File

@ -8,9 +8,9 @@ use nu_protocol::{
use std::io::{stdout, Write}; use std::io::{stdout, Write};
#[derive(Clone)] #[derive(Clone)]
pub struct InputKeys; pub struct KeybindingsListen;
impl Command for InputKeys { impl Command for KeybindingsListen {
fn name(&self) -> &str { fn name(&self) -> &str {
"keybindings listen" "keybindings listen"
} }
@ -141,11 +141,11 @@ fn print_events_helper(event: Event) -> Result<Value, ShellError> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::InputKeys; use crate::KeybindingsListen;
#[test] #[test]
fn examples_work_as_expected() { fn examples_work_as_expected() {
use crate::test_examples; use crate::test_examples;
test_examples(InputKeys {}) test_examples(KeybindingsListen {})
} }
} }

View File

@ -1,9 +1,9 @@
mod command; mod keybindings;
mod default_keybindings; mod keybindings_default;
mod input_keys; mod keybindings_list;
mod list_keybindings; mod keybindings_listen;
pub use command::Keybindings; pub use keybindings::Keybindings;
pub use default_keybindings::DefaultKeybindings; pub use keybindings_default::KeybindingsDefault;
pub use input_keys::InputKeys; pub use keybindings_list::KeybindingsList;
pub use list_keybindings::ListKeybindings; pub use keybindings_listen::KeybindingsListen;

View File

@ -1,9 +1,9 @@
mod bool; mod bool;
mod chars; mod chars;
mod command;
mod decimal; mod decimal;
mod dice; mod dice;
mod integer; mod integer;
mod random_;
mod uuid; mod uuid;
pub use self::bool::SubCommand as RandomBool; pub use self::bool::SubCommand as RandomBool;
@ -12,4 +12,4 @@ pub use self::decimal::SubCommand as RandomDecimal;
pub use self::dice::SubCommand as RandomDice; pub use self::dice::SubCommand as RandomDice;
pub use self::integer::SubCommand as RandomInteger; pub use self::integer::SubCommand as RandomInteger;
pub use self::uuid::SubCommand as RandomUuid; pub use self::uuid::SubCommand as RandomUuid;
pub use command::RandomCommand as Random; pub use random_::RandomCommand as Random;

View File

@ -1,16 +1,16 @@
pub mod camel_case; pub mod camel_case;
pub mod command;
pub mod kebab_case; pub mod kebab_case;
pub mod pascal_case; pub mod pascal_case;
pub mod screaming_snake_case; pub mod screaming_snake_case;
pub mod snake_case; pub mod snake_case;
pub mod str_;
pub use camel_case::SubCommand as StrCamelCase; pub use camel_case::SubCommand as StrCamelCase;
pub use command::Str;
pub use kebab_case::SubCommand as StrKebabCase; pub use kebab_case::SubCommand as StrKebabCase;
pub use pascal_case::SubCommand as StrPascalCase; pub use pascal_case::SubCommand as StrPascalCase;
pub use screaming_snake_case::SubCommand as StrScreamingSnakeCase; pub use screaming_snake_case::SubCommand as StrScreamingSnakeCase;
pub use snake_case::SubCommand as StrSnakeCase; pub use snake_case::SubCommand as StrSnakeCase;
pub use str_::Str;
use nu_engine::CallExt; use nu_engine::CallExt;

View File

@ -38,7 +38,7 @@ impl Command for Str {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use super::*; use crate::Str;
#[test] #[test]
fn test_examples() { fn test_examples() {

View File

@ -1,2 +1,2 @@
mod command; mod trim_;
pub use command::SubCommand as Trim; pub use trim_::SubCommand as Trim;

View File

@ -321,7 +321,8 @@ fn trim(s: &str, char_: Option<char>, closure_flags: &ClosureFlags) -> String {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use crate::strings::str_::trim::trim_::*;
use nu_protocol::{Span, Value};
#[test] #[test]
fn test_examples() { fn test_examples() {