Commit Graph

5362 Commits

Author SHA1 Message Date
kik4444
38a42905ae
Fix touch to allow changing timestamps on directories, remake from #11760 (#12005)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

Based off of #11760 to be mergable without conflicts.

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
Fix for #11757.
The main issue in #11757 is I tried to copy the timestamp from one
directory to another only to realize that did not work whereas the
coreutils `^touch` had no problems. I thought `--reference` just did not
work, but apparently the whole `touch` command could not work on
directories because
`OpenOptions::new().write(true).create(true).open(&item)` tries to
create `touch`'s target in advance and then modify its timestamps. But
if the target is a directory that already exists then this would fail
even though the crate used for working with timestamps, `filetime`,
already works on directories.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
I don't believe this should change any existing valid behaviors. It just
changes a non-working behavior.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
~~I only could not run `cargo test` because I get compilation errors on
the latest main branch~~
All tests pass with `cargo test --features=sqlite`

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-03-01 07:23:03 -06:00
Olilin1
39cf43ef06
Fix: string_to_table in ssv.rs now filters comments. (issue #11997) (#12035)
- Fixes #11997

# Description
Fixes the issue that comments are not ignored in SSV formatted data.
![Fix
image](https://github.com/nushell/nushell/assets/64328283/1c1bd7dd-ced8-4276-8c21-b50e1c0dba53)

# User-Facing Changes
If you have a comment in the beginning of SSV formatted data it is now
not included in the SSV table.

# Tests + Formatting
The PR adds one test in the ssv.rs file. All previous test-cases are
still passing. Clippy and Fmt have been ran.
2024-03-01 07:11:13 -06:00
Darren Schroeder
262914cf92
remove old mv command in favor of umv (renamed to mv) (#12022)
# Description

This PR removes our old nushell `mv` command in favor of the
uutils/coreutils `uu_mv` crate's `mv` command which we integrated in
0.90.1.

# User-Facing Changes

# Tests + Formatting

# After Submitting
2024-03-01 09:37:23 +08:00
Devyn Cairns
4c4609d646
Plugin StreamReader: fuse the iterator after an error (#12027)
# Description

This patches `StreamReader`'s iterator implementation to not return any
values after an I/O error has been encountered.

Without this, it's possible for a protocol error to cause the channel to
disconnect, in which case every call to `recv()` returns an error, which
causes the iterator to produce error values infinitely. There are some
commands that don't immediately stop after receiving an error so it's
possible that they just get stuck in an infinite error. This fixes that
so the error is only produced once, and then the stream ends
artificially.
2024-02-29 23:39:17 +01:00
Wind
65e5abaa3e
deprecate str escape-glob command (#12018)
# Description
After some iteration on globbing rules, I don't think `str escape-glob`
is needed

# User-Facing Changes
```nushell
❯ let f = "[ab]*.nu"
❯ $f | str escape-glob
Error:   × str escape-glob is deprecated
   ╭─[entry #1:1:6]
 1 │ $f | str escape-glob
   ·      ───────┬───────
   ·             ╰── if you are trying to escape a variable, you don't need to do it now
   ╰────
  help: Remove `str escape-glob` call

[[]ab[]][*].nu
```

# Tests + Formatting
NaN

# After Submitting
NaN
2024-02-29 20:29:56 +08:00
Panagiotis Ganelis
f24877ba08
fix: process empty headers in to md command (#12012)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->
fixes #12006

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
Process empty headers as well in `to md` command.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-28 20:44:11 -06:00
Devyn Cairns
ab08328a30
Add Goodbye message to ensure plugins exit when they are no longer needed (#12014)
# Description

This fixes a race condition where all interfaces to a plugin might have
been dropped, but both sides are still expecting input, and the
`PluginInterfaceManager` doesn't get a chance to see that the interfaces
have been dropped and stop trying to consume input.

As the manager needs to hold on to a writer, we can't automatically
close the stream, but we also can't interrupt it if it's in a waiting to
read. So the best solution is to send a message to the plugin that we
are no longer going to be sending it any plugin calls, so that it knows
that it can exit when it's done.

This race condition is a little bit tricky to trigger as-is, but can be
more noticeable when running plugins in a tight loop. If too many plugin
processes are spawned at one time, Nushell can start to encounter "too
many open files" errors, and not be very useful.


# User-Facing Changes


# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

I will need to add `Goodbye` to the protocol docs
2024-02-28 20:41:22 -06:00
Darren Schroeder
345edbbe10
add is-not-empty command as a QOL improvement (#11991)
# Description

This PR adds `is-not-empty` as a counterpart to `is-empty`. It's the
same code but negates the results. This command has been asked for many
times. So, I thought it would be nice for our community to add it just
as a quality-of-life improvement. This allows people to stop writing
their `def is-not-empty [] { not ($in | is-empty) }` custom commands.

I'm sure there will be some who disagree with adding this, I just think
it's like we have `in` and `not-in` and helps fill out the language and
makes it a little easier to use.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-28 17:11:44 -06:00
Devyn Cairns
e69a02d379
Add tee command for operating on copies of streams (#11928)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

[Related conversation on
Discord](https://discord.com/channels/601130461678272522/615329862395101194/1209951539901366292)

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

This is inspired by the Unix tee command, but significantly more
powerful. Rather than just writing to a file, you can do any kind of
stream operation that Nushell supports within the closure.

The equivalent of Unix `tee -a file.txt` would be, for example, `command
| tee { save -a file.txt }` - but of course this is Nushell, and you can
do the same with structured data to JSON objects, or even just run any
other command on the system with it.

A `--stderr` flag is provided for operating on the stderr stream from
external programs. This may produce unexpected results if the stderr
stream is not then also printed by something else - nushell currently
doesn't. See #11929 for the fix for that.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

If someone was using the system `tee` command, they might be surprised
to find that it's different.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`


# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-28 17:08:31 -06:00
Ian Manske
0126620c19
Disable flaky network tests (#12010)
# Description
Ignores some network tests that sometimes fail in CI. E.g., in
[11953](https://github.com/nushell/nushell/pull/11953#issuecomment-1962275863)
and
[11654](https://github.com/nushell/nushell/pull/11654#issuecomment-1968404551).
2024-02-28 16:28:33 +00:00
Wind
387328fe73
Glob: don't allow implicit casting between glob and string (#11992)
# Description
As title, currently on latest main, nushell confused user if it allows
implicit casting between glob and string:
```nushell
let x = "*.txt"
def glob-test [g: glob] { open $g } 
glob-test $x
```
It always expand the glob although `$x` is defined as a string.
This pr implements a solution from @kubouch :
> We could make it really strict and disallow all autocasting between
globs and strings because that's what's causing the "magic" confusion.
Then, modify all builtins that accept globs to accept oneof(glob,
string) and the rules would be that globs always expand and strings
never expand

# User-Facing Changes
After this pr, user needs to use `into glob` to invoke `glob-test`, if
user pass a string variable:
```nushell
let x = "*.txt"
def glob-test [g: glob] { open $g } 
glob-test ($x | into glob)
```
Or else nushell will return an error.
```
 3 │ glob-test $x
   ·           ─┬
   ·            ╰── can't convert string to glob
```

# Tests + Formatting
Done

# After Submitting
Nan
2024-02-28 23:05:35 +08:00
Wind
eaedb30a8c
Don't expanding globs if user pass variables. (#11946)
# Description
Fixes: #11912

# User-Facing Changes
After this change: 
```
let x = '*.nu'; ^echo $x
```
will no longer expand glob.
If users still want to expand glob, there are also 3 ways to do this:
```
# 1. use spread operation with `glob` command
let x = '*.nu'; ^echo ...(glob $x)
```
# Tests + Formatting
Done

# After Submitting
NaN
2024-02-28 23:05:09 +08:00
ZzMzaw
c6cb406a53
Allow clear command to clear terminal's history (#12008)
This PR should close #11693.

# Description

This PR just adds a '--all' flag to the `clear` command in order to
clear the terminal and its history.

By default, the `clear` command only scrolls down.
In some cases, clearing the history as well can be useful.

Default behavior does not change.

Even if the `clear` command can be extended form within nushell, having
it in out of the box would allow to use it raw, without any
customization required.
Last but not least, it is pretty easy to implement as it is already
supported by the crate which is used to clear the terminal
(`crossterm`).

Providing relevant screenshot is pretty difficult because the result is
the same.
In the `clear --all` case, you just cannot scroll back anymore.

# User-Facing Changes

`clear` just scrolls down as usual without wiping the history of the
terminal.

` clear --all` scrolls down and wipe the terminal's history which means
scrolling back is no more possible.

# Tests + Formatting

General formatting and tests pass and have been executed on Linux only.
I don't have any way to test it on other systems.
There are no specific tests for the `clear` command so I didn't add any
(and I am not sure how to do if I had to).
Clear command is just a wrapper of the `crossterm` crate Clear command.

I would be more than happy if someone else was able to test it in other
context (even if it may be good as we rely on the crossterm crate).

# After Submitting

PR for documentation has been drafted:
https://github.com/nushell/nushell.github.io/pull/1266.
I'll update it with version if this PR is merged.

---------

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2024-02-28 07:49:41 -06:00
moonlander
d3895d71db
add binary data handling to bits commands (#11854)
# Description
- enables `bits` commands to operate on binary data, where both inputs
are binary and can vary in length
- adds an `--endian` flag to `bits and`, `or`, `xor` for specifying
endianness (for binary values of different lengths)

# User-Facing Changes
- `bits` commands will no longer error for non-int inputs
- the default for `--number-bytes` is now `auto` (infer int size;
changed from 8)

# Tests + Formatting
> addendum: first PR, please inform if any changes are needed
2024-02-28 20:43:50 +08:00
Justin Ma
7b95e37bbe
Making coreutils umkdir as the default mkdir (#12007)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
`umkdir` was added in #10785, I think it's time to replace the default
one.

# After Submitting

Remove the old `mkdir` command and making coreutils' `umkdir` as the
default
2024-02-28 06:27:10 -06:00
Ian Manske
bf425874b8
Add upsert example (#12001)
# Description
Adds one example to `help upsert` that indirectly uses the `$in` value
in a closure.
2024-02-27 17:54:29 -06:00
moonlander
ecaed7f0ae
add --signed flag for binary into int conversions (#11902)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
- adds a `--signed` flag to `into int` to allow parsing binary values as
signed integers, the integer size depends on the length of the binary
value

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
- attempting to convert binary values larger than 8 bytes into integers
now throws an error, with or without `--signed`

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
- wrote 3 tests and 1 example for `into int --signed` usage
- added an example for unsigned binary `into int`

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
- will add examples from this PR to `into int` documentation
2024-02-27 15:05:26 +00:00
Jack Wright
2a721bad52
Add columns to dataframe that are present in the schema but not present the Dataframe when applying schema. (#11987) 2024-02-26 17:22:33 -06:00
132ikl
f4d9ddd3ad
Fix completions for directories with hidden files (#11921)
# Description
Attempting to complete a directory with hidden files could cause a
variety of issues. When Rust parses the partial path to be completed
into components, it removes the trailing `.` since it interprets this to
mean "the current directory", but in the case of the completer we
actually want to treat the trailling `.` as a literal `.`. This PR fixes
this by adding a `.` back into the Path components if the last character
of the path is a `.` AND the path is longer than 1 character (eg., not
just a ".", since that correctly gets interpreted as Component::CurDir).

Here are some things this fixes:
- Panic when tab completing for hidden files in a directory with hidden
files (ex. `ls test/.`)
- Panic when tab completing a directory with only hidden files (since
the common prefix ends with a `.`, causing the previous issue)
- Mishandling of tab completing hidden files in directory (ex. `ls
~/.<TAB>` lists all files instead of just hidden files)
- Trailing `.` being inexplicably removed when tab completing a
directory without hidden files

While testing for this PR I also noticed there is a similar issue when
completing with `..` (ex. `ls ~/test/..<TAB>`) which is not fixed by
this PR (edit: see #11922).

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
N/A

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
Added a hidden-files-within-directories test to the `file_completions`
test.

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-26 12:14:19 -06:00
Darren Schroeder
43687207b4
allow current day to be highlighted (#11954)
# Description

This PR tweaks the built-in `cal` command so that it's still nushell-y
but looks closer to the "expected" cal by abbreviating the name of the
days. I also added the ability to color the current day with the current
"header" color.

### Before

![image](https://github.com/nushell/nushell/assets/343840/c7ad3017-d872-4d39-926d-cc99b097d934)

### After

![image](https://github.com/nushell/nushell/assets/343840/735c4f2e-9867-4cd7-ae3b-397dd02059d7)



# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-26 08:31:46 -06:00
Yash Thakur
c0ff0f12f0
Add ConfigDirNotFound error (#11849)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

Currently, there's multiple places that look for a config directory, and
each of them has different error messages when it can't be found. This
PR makes a `ConfigDirNotFound` error to standardize the error message
for all of these cases.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

Previously, the errors in `create_nu_constant()` would say which config
file Nushell was trying to get when it couldn't find the config
directory. Now it doesn't. However, I think that's fine, given that it
doesn't matter whether it couldn't find the config directory while
looking for `login.nu` or `env.nu`, it only matters that it couldn't
find it.

This is what the error looks like:


![image](https://github.com/nushell/nushell/assets/45539777/52298ed4-f9e9-4900-bb94-1154d389efa7)

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->

---------

Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com>
2024-02-26 15:42:20 +08:00
dependabot[bot]
2697ea9a25
Bump mockito from 1.2.0 to 1.3.0 (#11976)
Bumps [mockito](https://github.com/lipanski/mockito) from 1.2.0 to
1.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/lipanski/mockito/releases">mockito's
releases</a>.</em></p>
<blockquote>
<h2>1.3.0</h2>
<ul>
<li><a
href="3e2d4662eb">Introduced</a>
<code>Server::new_with_opts</code>,
<code>Server::new_with_opts_async</code> and the <code>ServerOpts</code>
struct to allow configuring the server host, port and enabling
auto-asserts (see next item)</li>
<li><a
href="3e2d4662eb">Added</a>
the <code>assert_on_drop</code> server option that allows you to
automatically call <code>assert()</code> whenever your mocks go out of
scope (defaults to false)</li>
<li><a
href="2ed230b5e9">Expose</a>
<code>Server::socket_address()</code> to return the raw server
<code>SocketAddr</code></li>
<li><a
href="efc7da13c5">Use</a>
only required features for dependencies</li>
<li><a
href="bcdcb2a154">Accept</a>
<code>hyper::header::HeaderValue</code> as a <code>match_header()</code>
value</li>
</ul>
<p>Thanks to <a
href="https://github.com/andrewtoth"><code>@​andrewtoth</code></a> <a
href="https://github.com/alexander-jackson"><code>@​alexander-jackson</code></a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a09f1f0009"><code>a09f1f0</code></a>
Bump to 1.3.0</li>
<li><a
href="0be6d7a184"><code>0be6d7a</code></a>
Merge pull request <a
href="https://redirect.github.com/lipanski/mockito/issues/191">#191</a>
from lipanski/server-opts</li>
<li><a
href="3e2d4662eb"><code>3e2d466</code></a>
Allow configuring the mock server (host, port, assert_on_drop)</li>
<li><a
href="12cb5d0786"><code>12cb5d0</code></a>
Add sponsor button</li>
<li><a
href="3cce903c0f"><code>3cce903</code></a>
Merge pull request <a
href="https://redirect.github.com/lipanski/mockito/issues/186">#186</a>
from alexander-jackson/feat/return-raw-socket-address</li>
<li><a
href="2ed230b5e9"><code>2ed230b</code></a>
feat: return raw socket address</li>
<li><a
href="496f26da87"><code>496f26d</code></a>
Merge pull request <a
href="https://redirect.github.com/lipanski/mockito/issues/185">#185</a>
from andrewtoth/less-deps</li>
<li><a
href="40138fe979"><code>40138fe</code></a>
Merge pull request <a
href="https://redirect.github.com/lipanski/mockito/issues/184">#184</a>
from andrewtoth/into-headername</li>
<li><a
href="efc7da13c5"><code>efc7da1</code></a>
Use only required features for dependencies</li>
<li><a
href="10d1081d80"><code>10d1081</code></a>
Add impl IntoHeaderName for &amp;HeaderName</li>
<li>Additional commits viewable in <a
href="https://github.com/lipanski/mockito/compare/1.2.0...1.3.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mockito&package-manager=cargo&previous-version=1.2.0&new-version=1.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 15:38:29 +08:00
dependabot[bot]
55b67e17bb
Bump tempfile from 3.9.0 to 3.10.0 (#11977)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.9.0 to
3.10.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md">tempfile's
changelog</a>.</em></p>
<blockquote>
<h2>3.10.0</h2>
<ul>
<li>Drop <code>redox_syscall</code> dependency, we now use
<code>rustix</code> for Redox.</li>
<li>Add <code>Builder::permissions</code> for setting the permissions on
temporary files and directories (thanks to <a
href="https://github.com/Byron"><code>@​Byron</code></a>).</li>
<li>Update rustix to 0.38.31.</li>
<li>Update fastrand to 2.0.1.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="61531eae61"><code>61531ea</code></a>
chore: release v3.10.0</li>
<li><a
href="e246c4a004"><code>e246c4a</code></a>
chore: update deps (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/275">#275</a>)</li>
<li><a
href="4a05e47d3b"><code>4a05e47</code></a>
feat: Add <code>Builder::permissions()</code> method. (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/273">#273</a>)</li>
<li><a
href="184ab8f5ca"><code>184ab8f</code></a>
fix: drop redox_syscall dependency (<a
href="https://redirect.github.com/Stebalien/tempfile/issues/272">#272</a>)</li>
<li>See full diff in <a
href="https://github.com/Stebalien/tempfile/compare/v3.9.0...v3.10.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tempfile&package-manager=cargo&previous-version=3.9.0&new-version=3.10.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 15:38:11 +08:00
dependabot[bot]
123547444c
Bump strum_macros from 0.25.3 to 0.26.1 (#11979)
Bumps [strum_macros](https://github.com/Peternator7/strum) from 0.25.3
to 0.26.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Peternator7/strum/releases">strum_macros's
releases</a>.</em></p>
<blockquote>
<h2>v0.26.1</h2>
<h2>0.26.1</h2>
<ul>
<li><a
href="https://redirect.github.com/Peternator7/strum/pull/325">#325</a>:
use <code>core</code> instead of <code>std</code> in VariantArray.</li>
</ul>
<h2>0.26.0</h2>
<h3>Breaking Changes</h3>
<ul>
<li>The <code>EnumVariantNames</code> macro has been renamed
<code>VariantNames</code>. The deprecation warning should steer you in
the right direction for fixing the warning.</li>
<li>The Iterator struct generated by EnumIter now has new bounds on it.
This shouldn't break code unless you manually
added the implementation in your code.</li>
<li><code>Display</code> now supports format strings using named fields
in the enum variant. This should be a no-op for most code.
However, if you were outputting a string like <code>&quot;Hello
{field}&quot;</code>, this will now be interpretted as a format
string.</li>
<li>EnumDiscriminant now inherits the repr and discriminant values from
your main enum. This makes the discriminant type
closer to a mirror of the original and that's always the goal.</li>
</ul>
<h3>New features</h3>
<ul>
<li>
<p>The <code>VariantArray</code> macro has been added. This macro adds
an associated constant <code>VARIANTS</code> to your enum. The constant
is a <code>&amp;'static [Self]</code> slice so that you can access all
the variants of your enum. This only works on enums that only
have unit variants.</p>
<pre lang="rust"><code>use strum::VariantArray;
<p>#[derive(Debug, VariantArray)]
enum Color {
Red,
Blue,
Green,
}</p>
<p>fn main() {
println!(&quot;{:?}&quot;, Color::VARIANTS); // prints:
[&quot;Red&quot;, &quot;Blue&quot;, &quot;Green&quot;]
}
</code></pre></p>
</li>
<li>
<p>The <code>EnumTable</code> macro has been <em>experimentally</em>
added. This macro adds a new type that stores an item for each variant
of the enum. This is useful for storing a value for each variant of an
enum. This is an experimental feature because
I'm not convinced the current api surface area is correct.</p>
<pre lang="rust"><code>use strum::EnumTable;
<p>#[derive(Copy, Clone, Debug, EnumTable)]
enum Color {
Red,
Blue,
</code></pre></p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Peternator7/strum/blob/master/CHANGELOG.md">strum_macros's
changelog</a>.</em></p>
<blockquote>
<h2>0.26.1</h2>
<ul>
<li><a
href="https://redirect.github.com/Peternator7/strum/pull/325">#325</a>:
use <code>core</code> instead of <code>std</code> in VariantArray.</li>
</ul>
<h2>0.26.0</h2>
<h3>Breaking Changes</h3>
<ul>
<li>The <code>EnumVariantNames</code> macro has been renamed
<code>VariantNames</code>. The deprecation warning should steer you in
the right direction for fixing the warning.</li>
<li>The Iterator struct generated by EnumIter now has new bounds on it.
This shouldn't break code unless you manually
added the implementation in your code.</li>
<li><code>Display</code> now supports format strings using named fields
in the enum variant. This should be a no-op for most code.
However, if you were outputting a string like <code>&quot;Hello
{field}&quot;</code>, this will now be interpretted as a format
string.</li>
<li>EnumDiscriminant now inherits the repr and discriminant values from
your main enum. This makes the discriminant type
closer to a mirror of the original and that's always the goal.</li>
</ul>
<h3>New features</h3>
<ul>
<li>
<p>The <code>VariantArray</code> macro has been added. This macro adds
an associated constant <code>VARIANTS</code> to your enum. The constant
is a <code>&amp;'static [Self]</code> slice so that you can access all
the variants of your enum. This only works on enums that only
have unit variants.</p>
<pre lang="rust"><code>use strum::VariantArray;
<p>#[derive(Debug, VariantArray)]
enum Color {
Red,
Blue,
Green,
}</p>
<p>fn main() {
println!(&quot;{:?}&quot;, Color::VARIANTS); // prints:
[&quot;Red&quot;, &quot;Blue&quot;, &quot;Green&quot;]
}
</code></pre></p>
</li>
<li>
<p>The <code>EnumTable</code> macro has been <em>experimentally</em>
added. This macro adds a new type that stores an item for each variant
of the enum. This is useful for storing a value for each variant of an
enum. This is an experimental feature because
I'm not convinced the current api surface area is correct.</p>
<pre lang="rust"><code>use strum::EnumTable;
<p>#[derive(Copy, Clone, Debug, EnumTable)]
enum Color {
Red,
Blue,
Green,
</code></pre></p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/Peternator7/strum/commits/v0.26.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=strum_macros&package-manager=cargo&previous-version=0.25.3&new-version=0.26.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 15:37:38 +08:00
Devyn Cairns
88f1f386bb
Bidirectional communication and streams for plugins (#11911) 2024-02-25 16:32:50 -06:00
Devyn Cairns
461f69ac5d
Rename spans in the serialized form of Value (#11972)
[Discord
context](https://discord.com/channels/601130461678272522/615962413203718156/1211158641793695744)

<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
Span fields were previously renamed to `internal_span` to discourage
their use in Rust code, but this change also affected the serde I/O for
Value. I don't believe the Python plugin was ever updated to reflect
this change.

This effectively changes it back, but just for the serialized form.
There are good reasons for doing this:

1. `internal_span` is a much longer name, and would be one of the most
common strings found in serialized Value data, probably bulking up the
plugin I/O

2. This change was never really meant to have implications for plugins,
and was just meant to be a hint that `.span()` should be used instead in
Rust code.

When Span refactoring is complete, the serialized form of Value will
probably change again in some significant way, so I think for now it's
best that it's left like this.

This has implications for #11911, particularly for documentation and for
the Python plugin as that was already updated in that PR to reflect
`internal_span`. If this is merged first, I will update that PR.

This would probably be considered a breaking change as it would break
plugin I/O compatibility (but not Rust code). I think it can probably go
in any major release though - all things considered, it's pretty minor,
and users are already expected to recompile plugins for new major
versions. However, it may also be worth holding off to do it together
with #11911 as that PR makes breaking changes in general a little bit
friendlier.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

Requires plugin recompile.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

Nothing outside of `Value` itself had to be changed to make tests pass.
I did not check the Python plugin and whether it works now, but it was
broken before. It may work again as I think the main incompatibility it
had was expecting to use `span`

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-25 15:49:10 -06:00
Stefan Holderbach
e09b4817e1
Fix future lint by truncate(false) in touch (#11863)
The following clippy lint on nightly would complain:
- https://rust-lang.github.io/rust-clippy/master/#/suspicious_open

We don't want to alter the content in `touch` or truncate by not
writing. While not fully applicable, may be good practice for
platforms/filesystems we are not aware of.
2024-02-25 00:02:48 +01:00
Stefan Holderbach
96744e3155
Fix cargo b -p nu-command --tests (#11939)
The feature `sqlite` is not active by default on `nu-command`.
Only when building `cargo b --all --tests` would the feature be
activated via `nu`'s feature requirements.

Make the tests conditional

Saw this when double checking the removals from #11938.
Making sure each crate still compiles individually, ensures both that
you can run subcrate tests independently and that the `cargo publish`
run will succeed to build the crate with the default feature set (see
the problems occurring for the `0.90.0` release.
2024-02-25 00:01:29 +01:00
Stefan Holderbach
7884de1941
Remove some unnecessary static Vecs (#11947)
Avoid unnecessary allocations or larger iterator structs

- Turn static `Vec`s into arrays when possible
- Use `std::iter::once`/`empty` where applicable
- Use `bool::then_some` in `detect column` `.chain`
- Drop in the bucket: de-vec-ing tests
2024-02-24 20:58:01 +01:00
Devyn Cairns
098527b263
Print stderr streams to stderr in pipeline_data::print_if_stream() (#11929)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

Related to #11928 - `tee --stderr` doesn't really work as expected
without it

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

Print stderr streams to stderr in `pipeline_data::print_if_stream()`

This corrects unexpected behavior if a stream from an external program
is transformed while still preserving its stderr output. Before this
change, that output is just drained and discarded. Worse, it's drained
to a buffer, which could be really slow and memory hungry if there's a
lot of output on stderr.

This is needed to make `tee --stderr` function in a non-surprising way.
See #11928

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

A script that was erroneously not producing stderr output before might
now, but I can't think of a lot of examples of an external stream being
transformed without being converted.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`


# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-24 15:32:39 +00:00
Jack Wright
995989dad4
Handling errors instead of killing the REPL (#11953)
Handle all errors that happen within the REPL loop, display warning or
error messages, and return defaults where necessary.

This addresses @IanManske [Comment Item
1](https://github.com/nushell/nushell/pull/11860#issuecomment-1959947240)
in #11860

---------

Co-authored-by: Jack Wright <jack.wright@disqo.com>
2024-02-24 15:26:06 +00:00
nils-degroot
67a63162b2
Add date support in from xlsx (#11952)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

This PR add date support when using the `open` command on a xlsx file,
and the using `from xlsx` on a xlsx file.
 
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

Currently dates in xlsx files are read as nulls, after this PR this
would be regular dates.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-24 07:25:51 -06:00
Maxim Zhiburt
6be91a68f3
nu-table: Improve table -a (#11905)
Hi there;

Sorry took that long to respond.

I guess it's good?
It will consume the whole stream whether possible.
I do believe it will be faster in WSL in general too (in a sense of
whole buffer output), but its interesting issue probably needed to be
separated. It was not very well explained as well.

```nushell
> 0..2000 | table -a 2
╭───┬──────╮
│ 0 │    0 │
│ 1 │    1 │
│ 2 │ ...  │
│ 3 │ 1999 │
│ 4 │ 2000 │
╰───┴──────╯
```

Take care

fix: #11845

cc: @fdncred
2024-02-23 19:12:10 -06:00
Wind
f7d647ac3c
open, rm, umv, cp, rm and du: Don't globs if inputs are variables or string interpolation (#11886)
# Description
This is a follow up to
https://github.com/nushell/nushell/pull/11621#issuecomment-1937484322

Also Fixes: #11838 

## About the code change
It applys the same logic when we pass variables to external commands:


0487e9ffcb/crates/nu-command/src/system/run_external.rs (L162-L170)

That is: if user input dynamic things(like variables, sub-expression, or
string interpolation), it returns a quoted `NuPath`, then user input
won't be globbed
 
# User-Facing Changes
Given two input files: `a*c.txt`, `abc.txt`

* `let f = "a*c.txt"; rm $f` will remove one file: `a*c.txt`. 
~* `let f = "a*c.txt"; rm --glob $f` will remove `a*c.txt` and
`abc.txt`~
* `let f: glob = "a*c.txt"; rm $f` will remove `a*c.txt` and `abc.txt`

## Rules about globbing with *variable*
Given two files: `a*c.txt`, `abc.txt`
| Cmd Type | example | Result |
| ----- | ------------------ | ------ |
| builtin | let f = "a*c.txt"; rm $f | remove `a*c.txt` |
| builtin | let f: glob = "a*c.txt"; rm $f | remove `a*c.txt` and
`abc.txt`
| builtin | let f = "a*c.txt"; rm ($f \| into glob) | remove `a*c.txt`
and `abc.txt`
| custom | def crm [f: glob] { rm $f }; let f = "a*c.txt"; crm $f |
remove `a*c.txt` and `abc.txt`
| custom | def crm [f: glob] { rm ($f \| into string) }; let f =
"a*c.txt"; crm $f | remove `a*c.txt`
| custom | def crm [f: string] { rm $f }; let f = "a*c.txt"; crm $f |
remove `a*c.txt`
| custom | def crm [f: string] { rm $f }; let f = "a*c.txt"; crm ($f \|
into glob) | remove `a*c.txt` and `abc.txt`

In general, if a variable is annotated with `glob` type, nushell will
expand glob pattern. Or else, we need to use `into | glob` to expand
glob pattern

# Tests + Formatting
Done

# After Submitting
I think `str glob-escape` command will be no-longer required. We can
remove it.
2024-02-23 09:17:09 +08:00
Darren Schroeder
a2a1c1656f
remove unused dependencies (#11938)
# Description

This PR removes unused dependencies. The `cargo machete --with-metadata`
tool was used to determine what is unused and then I recompiled. Putting
this up here to see what happens in MacOS and Linux in the CI and see if
anything breaks.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-22 16:31:37 -06:00
Devyn Cairns
28f58057b6
Replace debug_assert! with assert! in Signature::check_names (#11937)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

Debug assertions don't run at release, which means that `cargo test
--release` fails because the tests for name checks don't run properly.
These checks are not really expensive, and there shouldn't be any
noticeable difference to startup time, so there isn't much reason not to
just leave them in.

It's valuable to be able to run `cargo test --release`, as that can
expose race conditions and dependencies on undefined behavior that
aren't exposed in debug builds.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

This shouldn't affect anything. Any violations of this rule were being
caught with debug tests, which are run by the CI.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`


# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-22 16:17:06 -06:00
Jack Wright
f17f857b1f
wrapping run_repl with catch_unwind and restarting the repl on panic (#11860)
Provides the ability to cleanly recover from panics, falling back to the
last known good state of EngineState and Stack. This pull request also
utilizes miette's panic handler for better formatting of panics.

<img width="642" alt="Screenshot 2024-02-21 at 08 34 35"
src="https://github.com/nushell/nushell/assets/56345/f81efaba-aa45-4e47-991c-1a2cf99e06ff">

---------

Co-authored-by: Jack Wright <jack.wright@disqo.com>
2024-02-22 12:14:10 -06:00
Devyn Cairns
cf68334fa0
Add support for the argument to zip being a closure (#11924)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

[Related conversation on
Discord](https://discord.com/channels/601130461678272522/615329862395101194/1209951539901366292)

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

This allows `zip` to consume two streams at the same time without having
to choose to fully consume one of them. Helpful for combining infinite
streams, or just large ones.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

Provides a way to consume another (possibly infinite) stream in `zip`,
rather than that being limited to open ranges.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-22 06:35:00 -06:00
Yash Thakur
6ff3a4180b
Specify which file not found in error (#11868)
# Description
Currently, `ShellError::FileNotFound` shows the span where the error
occurred but doesn't say which file wasn't found. This PR makes it so
the help includes that (like the `DirectoryNotFound` error).

# User-Facing Changes
No breaking changes, it's just that when a file can't be found, the help
will say which file couldn't be found:


![image](https://github.com/nushell/nushell/assets/45539777/e52f1e65-55c1-4cd2-8108-a4ccc334a66f)
2024-02-21 21:27:13 +08:00
Wind
1058707a29
make stderr works for failed external command (#11914)
# Description
Fixes: #11913

When running external command, nushell shouldn't consumes stderr
messages, if user want to redirect stderr.

# User-Facing Changes
NaN

# Tests + Formatting
Done

# After Submitting
NaN
2024-02-21 21:15:05 +08:00
Stefan Holderbach
6e590fe0a2
Remove unused Index(Mut) impls on AST types (#11903)
# Description
Both `Block` and `Pipeline` had `Index`/`IndexMut` implementations to
access their elements, that are currently unused.
Explicit helpers or iteration would generally be preferred anyways but
in the current state the inner containers are `pub` and are liberally
used. (Sometimes with potentially panicking indexing or also iteration)

As it is potentially unclear what the meaning of the element from a
block or pipeline queried by a usize is, let's remove it entirely until
we come up with a better API.

# User-Facing Changes
None

Plugin authors shouldn't dig into AST internals
2024-02-21 18:02:30 +08:00
Darren Schroeder
b23fe30530
fixes debug info not populating process information (#11909)
# Description

This PR fixes #11901. For some reason `debug info` stopped reporting
information. This hopefully fixes it. I think something changes in the
`sysinfo` crate that stopped it from working.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-20 13:34:11 -06:00
David Matos
123bf2d736
fix format date based on users locale (#11908)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->
# Description
Hi, 

Fixes #10838, where before the `date` would be formatted incorrectly,
and was not picking `LC_TIME` for time formatting, but it picked the
first locale returned by the `sys-locale` crate instead. Now it will
format time based on `LC_TIME`. For example,

```
// my locale `nl_NL.UTF-8`
❯ date now | format date '%x %X'
20-02-24 17:17:12

$env.LC_TIME = "en_US.UTF-8"

❯ date now | format date '%x %X'
02/20/2024 05:16:28 PM
```
Note that I also changed the `default_env.nu` as otherwise the Time will
show AM/PM twice. Also reason for the `chrono` update is because this
relies on a fix to upstream repo, which i initially submitted an
[issue](https://github.com/chronotope/chrono/issues/1349#event-11765363286)

<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- [X] `cargo fmt --all -- --check` to check standard code formatting
(`cargo fmt --all` applies these changes)
- [X] `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used`
to check that you're using the standard code style
- [X] `cargo test --workspace` to check that all tests pass (on Windows
make sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- [X] `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```


# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-20 11:08:49 -06:00
dannou812
7c1eb6b0c8
move-Command Tests, Refactor, Fix (#11904)
fixes #11783 

# Description
Firstly Tests for the `move` Command have been added. Afterwards some
duplicate Code has been removed and finally an error-message has been
added for when a column is tried to be moved based on itself. This
should fix #11783 .

To reiterate, the example of the initial issue now plays out as follows:
```shell
> {a: 1} | move a --after a                             
Error: nu:🐚:incompatible_parameters

  × Incompatible parameters.
   ╭─[entry #1:1:15]
 1 │ {a: 1} | move a --after a
   ·               ┬         ┬
   ·               │         ╰── relative to itself
   ·               ╰── Column cannot be moved
   ╰────
``` 

# User-Facing Changes
The error message shown above.

# Tests + Formatting
I added some Tests for the behavior of the command. If I should add
more, please let me know but I added everything that came to mind when
thinking about the command.

---------

Co-authored-by: dannou812 <dannou281@gmail.com>
2024-02-20 07:23:46 -06:00
Darren Schroeder
63ccc62a24
allow last to work with ranges (#11906)
# Description

This PR allows `last` to work with ranges in the same way that `first`
does. It also adds a couple examples demonstrating it.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-20 06:28:50 -06:00
Filipe Paniguel
c0bac5a440
style: correct keybinding name and improve formatting in default_config.nu (#11889)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
This PR addresses a minor mismatch in a keybinding name within the
`default_config.nu` file. Additionally, it applies formatting for
consistency.
# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2024-02-18 20:50:50 -06:00
dependabot[bot]
68a3d7c430
Bump trash from 3.2.1 to 3.3.1 (#11894)
Bumps [trash](https://github.com/ArturKovacs/trash) from 3.2.1 to 3.3.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ArturKovacs/trash/releases">trash's
releases</a>.</em></p>
<blockquote>
<h2>v3.3.1</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Use <code>AtomicI32</code> instead of I64 for compatibility with
<code>armel</code></li>
</ul>
<h3>Commit Statistics</h3>
<ul>
<li>1 commit contributed to the release.</li>
<li>2 days passed between releases.</li>
<li>1 commit was understood as <a
href="https://www.conventionalcommits.org">conventional</a>.</li>
<li>1 unique issue was worked on: <a
href="https://redirect.github.com/ArturKovacs/trash/issues/99">#99</a></li>
</ul>
<h3>Commit Details</h3>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<ul>
<li><strong><a
href="https://redirect.github.com/ArturKovacs/trash/issues/99">#99</a></strong>
<ul>
<li>Use <code>AtomicI32</code> instead of I64 for compatibility with
<code>armel</code> (98049f1)</li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
<h2>v3.3.0</h2>
<h3>New Features</h3>
<ul>
<li>improved error granularity
Inform about operating-system specific errors more clearly, thus avoid
degenerating error information.</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>Use <code>AtomicI32</code> in tests for compatibility with
<code>armel</code> platform</li>
</ul>
<h3>Commit Statistics</h3>
<ul>
<li>5 commits contributed to the release over the course of 5 calendar
days.</li>
<li>25 days passed between releases.</li>
<li>2 commits were understood as <a
href="https://www.conventionalcommits.org">conventional</a>.</li>
<li>1 unique issue was worked on: <a
href="https://redirect.github.com/ArturKovacs/trash/issues/99">#99</a></li>
</ul>
<h3>Commit Details</h3>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<ul>
<li><strong><a
href="https://redirect.github.com/ArturKovacs/trash/issues/99">#99</a></strong>
<ul>
<li>Use <code>AtomicI32</code> in tests for compatibility with
<code>armel</code> platform (920ff0c)</li>
</ul>
</li>
<li><strong>Uncategorized</strong>
<ul>
<li>Improved error granularity (452be83)</li>
<li>Removed tracing. (2b1c9fa)</li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Byron/trash-rs/blob/master/CHANGELOG.md">trash's
changelog</a>.</em></p>
<blockquote>
<h2>3.3.1 (2024-02-12)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><!-- raw HTML omitted --> Use <code>AtomicI32</code> instead of I64
for compatibility with <code>armel</code></li>
</ul>
<h3>Commit Statistics</h3>
<!-- raw HTML omitted -->
<ul>
<li>1 commit contributed to the release.</li>
<li>2 days passed between releases.</li>
<li>1 commit was understood as <a
href="https://www.conventionalcommits.org">conventional</a>.</li>
<li>1 unique issue was worked on: <a
href="https://redirect.github.com/Byron/trash-rs/issues/99">#99</a></li>
</ul>
<h3>Commit Details</h3>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<ul>
<li><strong><a
href="https://redirect.github.com/Byron/trash-rs/issues/99">#99</a></strong>
<ul>
<li>Use <code>AtomicI32</code> instead of I64 for compatibility with
<code>armel</code> (<a
href="98049f1316"><code>98049f1</code></a>)</li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
<h2>3.3.0 (2024-02-10)</h2>
<h3>New Features</h3>
<ul>
<li><!-- raw HTML omitted --> improved error granularity
Inform about operating-system specific errors more clearly, thus avoid
degenerating error information.</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><!-- raw HTML omitted --> Use <code>AtomicI32</code> in tests for
compatibility with <code>armel</code> platform</li>
</ul>
<h3>Commit Statistics</h3>
<!-- raw HTML omitted -->
<ul>
<li>6 commits contributed to the release over the course of 5 calendar
days.</li>
<li>25 days passed between releases.</li>
<li>2 commits were understood as <a
href="https://www.conventionalcommits.org">conventional</a>.</li>
<li>1 unique issue was worked on: <a
href="https://redirect.github.com/Byron/trash-rs/issues/99">#99</a></li>
</ul>
<h3>Commit Details</h3>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="b6e2d6c57f"><code>b6e2d6c</code></a>
Release trash v3.3.1</li>
<li><a
href="98049f1316"><code>98049f1</code></a>
fix: Use <code>AtomicI32</code> instead of I64 for compatibility with
<code>armel</code> (<a
href="https://redirect.github.com/ArturKovacs/trash/issues/99">#99</a>)</li>
<li><a
href="d0d8f26030"><code>d0d8f26</code></a>
Release trash v3.3.0</li>
<li><a
href="920ff0c69f"><code>920ff0c</code></a>
fix: Use <code>AtomicI32</code> in tests for compatibility with
<code>armel</code> platform (<a
href="https://redirect.github.com/ArturKovacs/trash/issues/99">#99</a>)</li>
<li><a
href="452be8303c"><code>452be83</code></a>
feat: improved error granularity</li>
<li><a
href="2b1c9fa2a9"><code>2b1c9fa</code></a>
Removed tracing.</li>
<li><a
href="b238938d7d"><code>b238938</code></a>
Bug fix for macOS.</li>
<li><a
href="671cef91f4"><code>671cef9</code></a>
Enhanced error reporting.</li>
<li>See full diff in <a
href="https://github.com/ArturKovacs/trash/compare/v3.2.1...v3.3.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=trash&package-manager=cargo&previous-version=3.2.1&new-version=3.3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 10:21:46 +08:00
dependabot[bot]
a4ef7c1ac4
Bump fancy-regex from 0.12.0 to 0.13.0 (#11893)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [fancy-regex](https://github.com/fancy-regex/fancy-regex) from
0.12.0 to 0.13.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/fancy-regex/fancy-regex/releases">fancy-regex's
releases</a>.</em></p>
<blockquote>
<h2>0.13.0</h2>
<h3>Added</h3>
<ul>
<li>Support for relative backreferences using <code>\k&lt;-1&gt;</code>
(-1 references the
previous group) (<a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/121">#121</a>)</li>
<li>Add <code>try_replacen</code> to <code>Regex</code> which returns a
<code>Result</code> instead of panicking
when matching errors (<a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/130">#130</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Switch from regex crate to regex-automata and regex-syntax (lower
level APIs)
to simplify internals (<a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/121">#121</a>)</li>
<li>Allow escaping some letters in character classes, e.g.
<code>[\A]</code> used to error
but now matches the same as <code>[A]</code> (for compatibility with
Oniguruma)</li>
<li>MSRV (minimum supported Rust version) is now 1.66.1 (from
1.61.0)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Fix index out of bounds panic when parsing unclosed <code>(?(</code>
(<a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/125">#125</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/fancy-regex/fancy-regex/blob/main/CHANGELOG.md">fancy-regex's
changelog</a>.</em></p>
<blockquote>
<h2>[0.13.0] - 2023-12-22</h2>
<h3>Added</h3>
<ul>
<li>Support for relative backreferences using <code>\k&lt;-1&gt;</code>
(-1 references the
previous group) (<a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/121">#121</a>)</li>
<li>Add <code>try_replacen</code> to <code>Regex</code> which returns a
<code>Result</code> instead of panicking
when matching errors (<a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/130">#130</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Switch from regex crate to regex-automata and regex-syntax (lower
level APIs)
to simplify internals (<a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/121">#121</a>)</li>
<li>Allow escaping some letters in character classes, e.g.
<code>[\A]</code> used to error
but now matches the same as <code>[A]</code> (for compatibility with
Oniguruma)</li>
<li>MSRV (minimum supported Rust version) is now 1.66.1 (from
1.61.0)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Fix index out of bounds panic when parsing unclosed <code>(?(</code>
(<a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/125">#125</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bf2c807447"><code>bf2c807</code></a>
Version 0.13.0</li>
<li><a
href="7b4ad1178d"><code>7b4ad11</code></a>
Merge pull request <a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/129">#129</a>
from fancy-regex/changelog-0.13</li>
<li><a
href="8d8ea4fcf9"><code>8d8ea4f</code></a>
Document how to check matching in Oniguruma</li>
<li><a
href="1fab2c7e0b"><code>1fab2c7</code></a>
Add character class escaping change</li>
<li><a
href="2d6339584d"><code>2d63395</code></a>
Add try_replacen</li>
<li><a
href="6deb4fc1b2"><code>6deb4fc</code></a>
Prepare CHANGELOG for next release</li>
<li><a
href="c0e701f821"><code>c0e701f</code></a>
Merge pull request <a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/130">#130</a>
from kevinhu/try_replacen</li>
<li><a
href="55f6549bec"><code>55f6549</code></a>
Add try_replacen</li>
<li><a
href="8ab3a44053"><code>8ab3a44</code></a>
Merge branch 'fancy-regex:main' into main</li>
<li><a
href="494cd931c3"><code>494cd93</code></a>
Merge pull request <a
href="https://redirect.github.com/fancy-regex/fancy-regex/issues/126">#126</a>
from robertknight/patch-1</li>
<li>Additional commits viewable in <a
href="https://github.com/fancy-regex/fancy-regex/compare/0.12.0...0.13.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=fancy-regex&package-manager=cargo&previous-version=0.12.0&new-version=0.13.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 09:54:37 +08:00
dependabot[bot]
6a1691f378
Bump miette from 7.0.0 to 7.1.0 (#11892)
Bumps [miette](https://github.com/zkat/miette) from 7.0.0 to 7.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/zkat/miette/releases">miette's
releases</a>.</em></p>
<blockquote>
<h2>v7.1.0</h2>
<h3>Features</h3>
<ul>
<li><strong>derive:</strong> enable more boxed types to be
#[diagnostic_source] (<a
href="https://redirect.github.com/zkat/miette/issues/338">#338</a>) (<a
href="c2f06f6cca">c2f06f6c</a>)</li>
<li><strong>source:</strong> derive common traits for NamedSource,
SourceSpan, and SourceOffset (<a
href="https://redirect.github.com/zkat/miette/issues/340">#340</a>) (<a
href="6f09250cca">6f09250c</a>)</li>
<li><strong>collection:</strong> add support for collection of labels
(<a href="https://redirect.github.com/zkat/miette/issues/341">#341</a>)
(<a
href="03060245d8">03060245</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>tests:</strong> revert test-breaking changes of e5c7ae4 (<a
href="https://redirect.github.com/zkat/miette/issues/339">#339</a>) (<a
href="6e829f8c0c">6e829f8c</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/zkat/miette/blob/main/CHANGELOG.md">miette's
changelog</a>.</em></p>
<blockquote>
<h2>7.1.0 (2024-02-16)</h2>
<h3>Features</h3>
<ul>
<li><strong>derive:</strong> enable more boxed types to be
#[diagnostic_source] (<a
href="https://redirect.github.com/zkat/miette/issues/338">#338</a>) (<a
href="c2f06f6cca">c2f06f6c</a>)</li>
<li><strong>source:</strong> derive common traits for NamedSource,
SourceSpan, and SourceOffset (<a
href="https://redirect.github.com/zkat/miette/issues/340">#340</a>) (<a
href="6f09250cca">6f09250c</a>)</li>
<li><strong>collection:</strong> add support for collection of labels
(<a href="https://redirect.github.com/zkat/miette/issues/341">#341</a>)
(<a
href="03060245d8">03060245</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>tests:</strong> revert test-breaking changes of e5c7ae4 (<a
href="https://redirect.github.com/zkat/miette/issues/339">#339</a>) (<a
href="6e829f8c0c">6e829f8c</a>)</li>
</ul>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a18a6444d9"><code>a18a644</code></a>
chore: Release</li>
<li><a
href="dc77b0cb5b"><code>dc77b0c</code></a>
docs: update changelog</li>
<li><a
href="03060245d8"><code>0306024</code></a>
feat(collection): add support for collection of labels (<a
href="https://redirect.github.com/zkat/miette/issues/341">#341</a>)</li>
<li><a
href="6f09250cca"><code>6f09250</code></a>
feat(source): derive common traits for NamedSource, SourceSpan, and
SourceOff...</li>
<li><a
href="c2f06f6cca"><code>c2f06f6</code></a>
feat(derive): enable more boxed types to be #[diagnostic_source] (<a
href="https://redirect.github.com/zkat/miette/issues/338">#338</a>)</li>
<li><a
href="6e829f8c0c"><code>6e829f8</code></a>
fix(tests): revert test-breaking changes of e5c7ae4 (<a
href="https://redirect.github.com/zkat/miette/issues/339">#339</a>)</li>
<li>See full diff in <a
href="https://github.com/zkat/miette/compare/miette-derive-v7.0.0...miette-derive-v7.1.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=miette&package-manager=cargo&previous-version=7.0.0&new-version=7.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 09:54:08 +08:00
dependabot[bot]
1350f1eff7
Bump unicode-segmentation from 1.10.1 to 1.11.0 (#11891)
Bumps
[unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation)
from 1.10.1 to 1.11.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8b894ca626"><code>8b894ca</code></a>
Bump to 1.11.0</li>
<li><a
href="184277a5f2"><code>184277a</code></a>
Merge pull request <a
href="https://redirect.github.com/unicode-rs/unicode-segmentation/issues/130">#130</a>
from syvb/rm_old_docs</li>
<li><a
href="bfe98e4642"><code>bfe98e4</code></a>
Remove outdated documentation link in Cargo.toml</li>
<li><a
href="062c264acf"><code>062c264</code></a>
Merge pull request <a
href="https://redirect.github.com/unicode-rs/unicode-segmentation/issues/128">#128</a>
from ryanavella/master</li>
<li><a
href="6375d1e431"><code>6375d1e</code></a>
Adding missing size_hint implementations.</li>
<li><a
href="e718ec3132"><code>e718ec3</code></a>
Merge pull request <a
href="https://redirect.github.com/unicode-rs/unicode-segmentation/issues/127">#127</a>
from nicolasmendoza/docs/update-changelogs-from-v1.9....</li>
<li><a
href="e9104b117d"><code>e9104b1</code></a>
Fix: Remove duplicate changelog</li>
<li><a
href="30a3e6bab2"><code>30a3e6b</code></a>
docs: Update changelog for versions 1.9.0 to 1.10.1</li>
<li><a
href="eb794dda07"><code>eb794dd</code></a>
docs: Update changelog for versions 1.9.0 to 1.10.1</li>
<li><a
href="8d165c5842"><code>8d165c5</code></a>
Merge pull request <a
href="https://redirect.github.com/unicode-rs/unicode-segmentation/issues/126">#126</a>
from nicolasmendoza/docs/update-changelogs</li>
<li>Additional commits viewable in <a
href="https://github.com/unicode-rs/unicode-segmentation/compare/v1.10.1...v1.11.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=unicode-segmentation&package-manager=cargo&previous-version=1.10.1&new-version=1.11.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 09:36:31 +08:00