- improves usability of datetime's in displayed text
-
# Description
Creates a config point for specifying long / short date time formats.
Defaults to humanized as we have today.
Provides for adding strftime formats into config.nu such as:
```nu
datetime_format: {
normal: "%Y-%m-%d %H:%M:%S"
table: "%Y-%m-%d"
}
```
Example:
```bash
> $env.config.datetime_format
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ normal ┃ %a, %d %b %Y %H:%M:%S %z ┃
┃ table ┃ %m/%d/%y %I:%M:%S%p ┃
┗━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━┛
> let a = (date now)
> echo $a
Thu, 22 Jun 2023 10:21:23 -0700
> echo [$a]
┏━━━┳━━━━━━━━━━━━━━━━━━━━━┓
┃ 0 ┃ 06/22/23 10:21:23AM ┃
┗━━━┻━━━━━━━━━━━━━━━━━━━━━┛
```
# User-Facing Changes
Any place converting a datetime to a user displayed value should be
impacted.
# Tests + Formatting
- `cargo fmt --all -- --check` Done
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` Done
- `cargo test --workspace` Done
- `cargo run -- crates/nu-std/tests/run.nu` Not done - doesn't seem to
work
```bash
> use toolkit.nu # or use an `env_change` hook to activate it automatically
> toolkit check pr
``` - Done
---------
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com>
# Description
Hi, I would like to add a couple of things to the `.gitignore` that
would probably not be preferred to be checked out.
Thanks in advance! :)
# User-Facing Changes
- none
# Tests + Formatting
- not affected
# After Submitting
- not affected
* Ignore `cargo tarpaulin` output files
* Add expected result for `columns` example
Examples without provided expected output will never be tested.
The subset of commands available in `test_examples()` is limited thus
excluding the tests depending on other commands
* Add example test harness to `reject`
* Test and fix `wrap` example
* Test and fix `drop column` example
* Update `from ods` examples
* Update `from xlsx` examples
* Run `to nuon` examples
* Run `hash base64` examples
* Add example output to `path parse`
* Test and fix the `grid` examples
* lazyframe definition
* expressions and lazy frames
* new alias expression
* more expression commands
* updated to polars main
* more expressions and groupby
* more expressions, fetch and sort-by
* csv reader
* removed open csv
* unique function
* joining functions
* join lazy frames commands with eager commands
* corrected tests
* Update .gitignore
* Update .gitignore
Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
* database commands
* db commands
* filesystem opens sqlite file
* clippy error
* corrected error in ci file
* removes matrix flag from ci
* flax matrix for clippy
* add conditional compile for tests
* add conditional compile for tests
* correct order of command
* correct error msg
* correct typo
* Changes to allow plugins to be loaded in a multi-threaded manner in order to decrease startup time.
* Ran rust fmt and clippy to find and fix first pass errors.
Updated launch.jason to make debugging easier in vscode.
Also added tasks.json so tasks like clippy can be ran easily.
* ran fmt again
* Delete launch.json
Remove IDE settings file
* Remove IDE settings file
* Ignore vscode IDE settings
* Cloned the context instead of Arc/Mutexing it.
Co-authored-by: Darren Schroeder <fdncred@hotmail.com>
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
This improves incremental build time when working on what was previously
the root package. For example, previously all plugins would be rebuilt
with a change to `src/commands/classified/external.rs`, but now only
`nu-cli` will have to be rebuilt (and anything that depends on it).
This commit migrates Value's numeric types to BigInt and BigDecimal. The
basic idea is that overflow errors aren't great in a shell environment,
and not really necessary.
The main immediate consequence is that new errors can occur when
serializing Nu values to other formats. You can see this in changes to
the various serialization formats (JSON, TOML, etc.). There's a new
`CoerceInto` trait that uses the `ToPrimitive` trait from `num_traits`
to attempt to coerce a `BigNum` or `BigDecimal` into a target type, and
produces a `RangeError` (kind of `ShellError`) if the coercion fails.
Another possible future consequence is that certain performance-critical
numeric operations might be too slow. If that happens, we can introduce
specialized numeric types to help improve the performance of those
situations, based on the real-world experience.