mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 08:40:14 +02:00
Refactor/fix tests affecting the whole command set (#15073)
# Description Pre-cratification of `nu-command` we added tests that covered the whole command set to ensure consistent documentation style choices and that the search terms which are added are not uselessly redundant. These tests are now moved into the suite of the main binary to truly cover all commands. - **Move parser quickcheck "fuzz" to `nu-cmd-lang`** - **Factor out creation of full engine state for tests** - **Move all-command tests to main context creation** - **Fix all descriptions** - **Fix search term duplicate** # User-Facing Changes As a result I had to fix a few command argument descriptions. (Doesn't mean I fully stand behind this choice, but) positionals (rest/required/optional) and top level descriptions should start with a capital letter and end with a period. This is not enforced for flags. # Tests + Formatting Furthermore I moved our poor-peoples-fuzzer that runs in CI with `quicktest` over the parser to `nu-cmd-lang` reducing its command set to just the keywords (similar to https://github.com/nushell/nushell/pull/15036). Thus this should also run slightly faster (maybe a slight parallel build cost due to earlier dependency on quicktest)
This commit is contained in:
committed by
GitHub
parent
2a3d5a9d42
commit
a58d9b0b3a
@ -26,7 +26,7 @@ impl Command for BitsAnd {
|
||||
.required(
|
||||
"target",
|
||||
SyntaxShape::OneOf(vec![SyntaxShape::Binary, SyntaxShape::Int]),
|
||||
"right-hand side of the operation",
|
||||
"Right-hand side of the operation.",
|
||||
)
|
||||
.named(
|
||||
"endian",
|
||||
|
@ -26,7 +26,7 @@ impl Command for BitsInto {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Deprecated)
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ impl Command for BitsOr {
|
||||
.required(
|
||||
"target",
|
||||
SyntaxShape::OneOf(vec![SyntaxShape::Binary, SyntaxShape::Int]),
|
||||
"right-hand side of the operation",
|
||||
"Right-hand side of the operation.",
|
||||
)
|
||||
.named(
|
||||
"endian",
|
||||
|
@ -37,7 +37,7 @@ impl Command for BitsRol {
|
||||
),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("bits", SyntaxShape::Int, "number of bits to rotate left")
|
||||
.required("bits", SyntaxShape::Int, "Number of bits to rotate left.")
|
||||
.switch(
|
||||
"signed",
|
||||
"always treat input number as a signed number",
|
||||
|
@ -37,7 +37,7 @@ impl Command for BitsRor {
|
||||
),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("bits", SyntaxShape::Int, "number of bits to rotate right")
|
||||
.required("bits", SyntaxShape::Int, "Number of bits to rotate right.")
|
||||
.switch(
|
||||
"signed",
|
||||
"always treat input number as a signed number",
|
||||
|
@ -40,7 +40,7 @@ impl Command for BitsShl {
|
||||
),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("bits", SyntaxShape::Int, "number of bits to shift left")
|
||||
.required("bits", SyntaxShape::Int, "Number of bits to shift left.")
|
||||
.switch(
|
||||
"signed",
|
||||
"always treat input number as a signed number",
|
||||
|
@ -37,7 +37,7 @@ impl Command for BitsShr {
|
||||
),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("bits", SyntaxShape::Int, "number of bits to shift right")
|
||||
.required("bits", SyntaxShape::Int, "Number of bits to shift right.")
|
||||
.switch(
|
||||
"signed",
|
||||
"always treat input number as a signed number",
|
||||
|
@ -27,7 +27,7 @@ impl Command for BitsXor {
|
||||
.required(
|
||||
"target",
|
||||
SyntaxShape::OneOf(vec![SyntaxShape::Binary, SyntaxShape::Int]),
|
||||
"right-hand side of the operation",
|
||||
"Right-hand side of the operation.",
|
||||
)
|
||||
.named(
|
||||
"endian",
|
||||
|
@ -26,7 +26,7 @@ impl Command for EachWhile {
|
||||
.required(
|
||||
"closure",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
||||
"the closure to run",
|
||||
"The closure to run.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ impl Command for Rotate {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::String,
|
||||
"the names to give columns once rotated",
|
||||
"The names to give columns once rotated.",
|
||||
)
|
||||
.category(Category::Filters)
|
||||
.allow_variants_without_examples(true)
|
||||
|
@ -16,7 +16,7 @@ impl Command for UpdateCells {
|
||||
.required(
|
||||
"closure",
|
||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
||||
"the closure to run an update for each cell",
|
||||
"The closure to run an update for each cell.",
|
||||
)
|
||||
.named(
|
||||
"columns",
|
||||
|
@ -38,7 +38,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"cell path",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, add a gradient to strings at the given cell paths",
|
||||
"For a data structure input, add a gradient to strings at the given cell paths.",
|
||||
)
|
||||
.input_output_types(vec![
|
||||
(Type::String, Type::String),
|
||||
|
@ -40,7 +40,7 @@ impl Command for FormatBits {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"for a data structure input, convert data at the given cell paths",
|
||||
"For a data structure input, convert data at the given cell paths.",
|
||||
)
|
||||
.category(Category::Conversions)
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ impl Command for FormatPattern {
|
||||
.required(
|
||||
"pattern",
|
||||
SyntaxShape::String,
|
||||
"the pattern to output. e.g.) \"{foo}: {bar}\"",
|
||||
"The pattern to output. e.g.) \"{foo}: {bar}\".",
|
||||
)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Strings)
|
||||
|
@ -20,7 +20,7 @@ impl Command for FormatNumber {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["display", "render", "format"]
|
||||
vec!["display", "render", "fmt"]
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
|
@ -25,7 +25,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"For a data structure input, convert strings at the given cell paths",
|
||||
"For a data structure input, convert strings at the given cell paths.",
|
||||
)
|
||||
.category(Category::Strings)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"For a data structure input, convert strings at the given cell paths",
|
||||
"For a data structure input, convert strings at the given cell paths.",
|
||||
)
|
||||
.category(Category::Strings)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"For a data structure input, convert strings at the given cell paths",
|
||||
"For a data structure input, convert strings at the given cell paths.",
|
||||
)
|
||||
.category(Category::Strings)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"For a data structure input, convert strings at the given cell paths",
|
||||
"For a data structure input, convert strings at the given cell paths.",
|
||||
)
|
||||
.category(Category::Strings)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"For a data structure input, convert strings at the given cell paths",
|
||||
"For a data structure input, convert strings at the given cell paths.",
|
||||
)
|
||||
.category(Category::Strings)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ impl Command for SubCommand {
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
"For a data structure input, convert strings at the given cell paths",
|
||||
"For a data structure input, convert strings at the given cell paths.",
|
||||
)
|
||||
.category(Category::Strings)
|
||||
}
|
||||
|
Reference in New Issue
Block a user