Commit Graph

53 Commits

Author SHA1 Message Date
Andrés N. Robalino
8fc8fc89aa
History, more test coverage improvements, and refactorings. (#3217)
Improvements overall to Nu. Also among the changes here, we can also be more confident towards incorporating `3041`. End to end tests for checking envs properly exported to externals is not added here (since it's in the other PR)

A few things added in this PR (probably forgetting some too)

* no writes happen to history during test runs.
* environment syncing end to end coverage added.
* clean up / refactorings few areas.
* testing API for finer control (can write tests passing more than one pipeline)
* can pass environment variables in tests that nu will inherit when running.

* No longer needed.

* no longer under a module. No need to use super.
2021-03-27 00:08:03 -05:00
Jonathan Turner
7e184b58b2
Fix warnings for Rust 1.51 (#3214)
* Fix warnings for Rust 1.51

* More fixes

* More fixes
2021-03-26 21:26:57 +13:00
Andrés N. Robalino
d2213d18fa
Playground infraestructure (tests, etc) additions. (#3179)
* Playground infraestructure (tests, etc) additions.

A few things to note:

* Nu can be started with a custom configuration file (`nu --config-file /path/to/sample_config.toml`). Useful for mocking the configuration on test runs.
* When given a custom configuration file Nu will save any changes to the file supplied appropiately.
* The `$nu.config-path` variable either shows the default configuration file (or the custom one, if given)
* We can now run end to end tests with finer grained control (currently, since this is baseline work, standard out) This will allow to check things like exit status, assert the contents with a format, etc)

* Remove (for another PR)
2021-03-15 02:26:30 -05:00
Darren Schroeder
983de8974b
hopefully fixes the coercion error when comparing $nothing to $var (#3133) 2021-03-05 14:07:54 -06:00
Darren Schroeder
2c89a228d5
add nu-ansi-term (#3089) 2021-02-22 12:33:34 -06:00
Andrés N. Robalino
08e7d0dfb6
Keep the environment properly set. (#3072)
* Revert "fix prompts on startup (#3056)"

This reverts commit b202951c1d.

* Ensure environment variables synced with global internal Nu Scope.
2021-02-18 15:56:14 +13:00
Jonathan Turner
5481db4079
Fix latest clippy warnings (#3049) 2021-02-12 23:13:14 +13:00
Saeed Rasooli
041086d22a
add config "filesize_metric = true" for default formatting of filesize (#3045) 2021-02-11 21:52:34 +13:00
ammkrn
aa564f5072
display boolean config options as true/false instead of Yes/No (#3043) 2021-02-11 21:50:33 +13:00
Darren Schroeder
fb1846120d
standardize on how to get file size (#2992)
* standardize on how to get file size

* forgot to remove comment

* make specified size lowercase

* fix the test due to precision

* added another test

* Update README.md

add contributors graphic

* clippy - test adjustment

* tweaked matching
2021-02-03 07:19:38 -06:00
Jonathan Turner
44e088c6fe
Move filesize to use bigint (#2984)
* Move filesize to be bigint-sized

* Add tests and fix filesize display

* clippy
2021-01-30 11:35:18 +13:00
Darren Schroeder
b052d524da
added pow operator, and filesize math (#2976)
* added pow operator, and filesize math

* removed + and - arms, removed some pow, pow higher precedence

* Update value.rs

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2021-01-29 07:44:02 -06:00
Darren Schroeder
47c4b8e88a
allow str from to convert more things to string (#2977)
* allow str from to convert more things to string

* fixed FileSize so it reports with units configured

* added tests
2021-01-29 07:43:35 -06:00
Darren Schroeder
b1e1dab4cb
add % operator for modulus, work with decimals (#2975)
* add % operator, work with decimals

* removed the % operator to reserve for something else
2021-01-26 12:42:34 -06:00
Caden Haustein
430da53f0b
Replace dirs and directories with maintained (#2949) 2021-01-19 14:24:27 -06:00
Anders Rasmussen
ebc4694e05
move keybinding_path to nu-data (#2927) 2021-01-14 06:31:47 +13:00
Jonathan Turner
0e13d9fbaa
Rename the Path and Pattern primitives (#2889)
* Rename the Path primitive to FilePath

* Rename glob pattern also

* more fun

* Fix the Windows path methods
2021-01-08 20:30:41 +13:00
Jonathan Turner
ac9909112f
Remove the line primitive (#2887) 2021-01-08 14:45:25 +13:00
Joseph T. Lyons
a5f7600f6f
Fix typos (#2842) 2021-01-02 17:24:32 +13:00
Darren Schroeder
f449baf8de
Change ls to output path (#2829)
* make name a path vs string

* add support for comparing path to string
2020-12-28 14:52:28 -06:00
Darren Schroeder
2eac79569c
highlight trailing spaces in tables in darkgray (#2794)
* highlight trailing spaces in tables in darkgray

* added leading spaces highlighting

* added config point to change the color

* Trigger Build
2020-12-18 07:47:05 -06:00
Stan Zhang
83c874666a
Date utility commands (#2780)
* updated & added date related commands based on the new design

* added proper error handling when date format string is invalid

* fixed format issue

* fixed an issue caused due to the change in primitive Date type

* added `date list-timezone` command to list all supported time zones and updated `date to-timezone` accordingly
2020-12-12 12:18:03 -06:00
Jonathan Turner
ee76523507
Add in parameter inference for blocks (#2706) 2020-10-27 20:37:35 +13:00
Darren Schroeder
3cf7652e86
fixed a bug where 'B' wasn't showing up (#2690)
right when get_appropriate_unit was called
2020-10-21 14:19:35 -05:00
Joseph T. Lyons
db590369a8
Fix filesize "B" regression (#2688) 2020-10-21 20:26:10 +13:00
Andrés N. Robalino
b6d19cc9fa
Move command changes. Refactorings. (#2683)
Continuing on anchoring and improvements on Nu's overall internal commands (#2635).
`move column` sub command has been turned into the command `move` since
we use it to move exclusively columns. Examples added as well.

Fixed it to carry along any anchor locations that might be in place if
table to be moved originates from other sources.
2020-10-20 04:07:13 -05:00
Darren Schroeder
bc6c884a14
added num-format to allow bytes to be formatted with commas. (#2681) 2020-10-19 12:52:11 -05:00
Darren Schroeder
cb78bf8fd6
add filesize_format to config (#2676) 2020-10-19 11:34:39 -05:00
Andrés N. Robalino
791e07650d
ColumnPath creation flexibility. (#2674) 2020-10-15 17:25:17 -05:00
Samuel Vanderwaal
2b076369e0
handle duration overflow error (#2616)
* handle duration overflow error

* handle checked_add_signed result
2020-10-09 14:51:47 +13:00
Andrés N. Robalino
973a8ee8f3
Allow config to work with column paths. (#2653)
Nu has many commands that allow the nuño to customize behavior such
as UI and behavior. Today, coloring can be customized, the line editor,
and other things. The more options there are, the higher the complexity
in managing them.

To mitigate this Nu can store configuration options as nested properties.

But to add and edit them can be taxing. With column path support we can
work with them easier.
2020-10-08 20:04:19 -05:00
Darren Schroeder
3c32d4947c
added blink and underline options to coloring (#2638) 2020-10-05 18:12:56 -05:00
Andrés N. Robalino
ae1d4bdb4c
Nushell internal commands. Anchor locations tracker surveying. (#2635) 2020-10-03 09:06:02 -05:00
Andrés N. Robalino
ddf9d61346
Line charts. Chart plugin sub command extraction. (#2627) 2020-10-01 19:23:10 -05:00
Andrés N. Robalino
a56abb6502
Bar Chart baseline. (#2621)
Bar Chart ready.
2020-09-30 13:27:52 -05:00
Chris Gillespie
892a416211
Move BTreeMap to IndexMap to preserve order (#2617) 2020-09-30 19:49:40 +13:00
Chris Gillespie
0a439fe52f
Removed unused files in nu-data (#2598) 2020-09-25 15:44:59 +12:00
Jonathan Turner
9b577b8679
Update bigint/bigdecimal (#2585)
* Update bigint/bigdecimal

* clippy
2020-09-22 05:28:31 +12:00
Radek Vít
15f3a545f0
Cleanup code in get and nu-value-ext (#2563)
* Cleanup code in get and nu-value-ext

* Remove unnecessary return statements from get
2020-09-18 18:40:20 +12:00
Andrés N. Robalino
10d4edc7af
Slim down configuration readings and nu_cli clean up. (#2559)
We continue refactoring nu_cli and slim down a bit configuration
readings with a naive metadata `modified` field check.
2020-09-16 18:22:58 -05:00
Radek Vít
599bb9797d
Implement exclusive and inclusive ranges with ..< and .. (#2541)
* Implement exclusive and inclusive ranges with .. and ..=

This commit adds right-exclusive ranges.

The original a..b inclusive syntax was changed to reflect the Rust notation.
New a..=b syntax was introduced to have the old behavior.

Currently, both a.. and b..= is valid, and it is unclear whether it's valid
to impose restrictions.

The original issue suggests .. for inclusive and ..< for exclusive ranges,
this can be implemented by making simple changes to this commit.

* Fix collect tests by changing ranges to ..=

* Fix clippy lints in exclusive range matching

* Implement exclusive ranges using `..<`
2020-09-14 09:53:08 +12:00
gorogoroumaru
45f32c9541
Allow math avg to work on durations (#2529)
* Allow `math avg` to work on durations

* formatting

* fix linting issue and implemented `math sum` for duration

* fix linting issue

* applied requested changes

* applied requested change for avg.rs

* formatting
2020-09-12 18:56:05 -05:00
Jonathan Turner
d9ae66791a
allow decimals as a range boundary (#2509) 2020-09-08 05:30:11 +12:00
Jonathan Turner
986b427038
Add modulo operator and simplify in/not-in (#2505) 2020-09-07 12:12:55 +12:00
Darren Schroeder
57a26bbd42
Default alignment (#2481)
* WIP - compiling but not working

* semi-working

* making progress

* working except for table lines

* fmt + clippy

* cleaned up some comments

* working line colors

* fmt, clippy, updated sample config.toml

* merges

* fixed bug where no config.toml or not set settings made weird defaults.

* clippy & fmt again

* Header default alignment is left.

Co-authored-by: Andrés N. Robalino <andres@androbtech.com>
2020-09-01 19:08:41 -05:00
Darren Schroeder
adbbcafd30
Add minor theme support (#2449)
* WIP - compiling but not working

* semi-working

* making progress

* working except for table lines

* fmt + clippy

* cleaned up some comments

* working line colors

* fmt, clippy, updated sample config.toml

* removed extra comments
2020-09-01 17:09:55 +12:00
Darren Schroeder
3f443f40d0
with_love table theme (#2468) 2020-08-31 11:50:32 -05:00
Darren Schroeder
8192360b20
added compact_double table theme for funsies (#2467) 2020-08-31 09:49:27 -05:00
Jonathan Turner
df691c6c91
Light fixes (#2455)
* Add optional commas for items in lists and tables

* A couple last fixes
2020-08-30 19:03:18 +12:00
Andrés N. Robalino
26cec83b63 Extract out history parts. 2020-08-27 06:28:18 -05:00