Commit Graph

211 Commits

Author SHA1 Message Date
e253ad54b5 Update doctest case for drive that now set PWD 2024-11-23 20:28:01 -08:00
b99578a2b4 Fix failed test case 2024-11-23 18:43:00 -08:00
a81adc5685 Cargo fmt 2024-11-23 18:39:31 -08:00
4e51c69bfe Typo: delimitor -> delimiter 2024-11-23 18:36:39 -08:00
913339fb63 Define PathError, Result will not use String as Err, make sure stored PWD has upper case drive letter. Update test cases for lowercased driver letter 2024-11-23 18:16:56 -08:00
e87eebcc5d Add else branch for Err on invalid drive letter. 2024-11-23 16:57:12 -08:00
26fb863a67 Guard for drive_letter before index 2024-11-23 16:52:42 -08:00
6ef5b04b25 Rename Drive2PWDmap as DriveToPwdMap, eliminate extra #[cfg(windows)] and mod _impl 2024-11-23 16:45:59 -08:00
63c9947247 Cargo fmt 2024-11-23 15:22:56 -08:00
16bf7fcc59 Update doctest to handle test runner on the same drive with the drive in test 2024-11-23 15:14:41 -08:00
0e79714483 Cargo clippy to simplify 2024-11-23 14:31:34 -08:00
a7c9695944 Remove path_abs, use omnipath is better, :) 2024-11-23 14:24:23 -08:00
c3b84abbf4 Use std::sync::OnceLock which eliminates unsafe code 2024-11-23 14:01:01 -08:00
825396baed Remove preceding \\?\ from path_abs UNC format 2024-11-23 12:15:35 -08:00
0850974860 Replace crate winapi with path_abs to simplify getting full path name, eliminate one segment of unsafe code block 2024-11-23 11:49:51 -08:00
9f56b1d64e Remove cfg-if crate 2024-11-23 10:56:03 -08:00
e9461395e9 Remove once_cell, using std::sync instead. Sync point move to engine_state to handle subshell PWD change problem 2024-11-22 21:02:15 -08:00
884214ecb4 Call set_pwd_per_drive() within stack::set_cwd() 2024-11-21 22:14:54 -08:00
0ba5efd43d Comments, fix testcase problems found in 'toolkit check pr' 2024-11-21 10:38:34 -08:00
e6b677392a clippy 2024-11-21 01:18:49 -08:00
4f70bb61a3 use super::* 2024-11-20 17:18:36 -08:00
1fe434bf30 use super:: 2024-11-20 17:10:35 -08:00
14b6da359a pub use to simplify usage 2024-11-20 16:52:16 -08:00
5dafde462a Eliminate warning on not used param path 2024-11-20 16:05:30 -08:00
b0614deb14 doctest verify 2024-11-20 15:51:19 -08:00
a6f95c282c Remove index 2024-11-20 15:17:22 -08:00
f22f2985a7 cargo next run --target x86_64-pc-windows-gnu 2024-11-19 19:05:03 -08:00
4832bc733e Test case platform result verify, revoke Cargo.lock Cargo.toml 2024-11-19 15:35:48 -08:00
98c77e1075 cargo fmt -all 2024-11-19 14:49:12 -08:00
9693c0a4a8 non-windows target compile 2024-11-19 13:38:07 -08:00
cf2d457718 Merge branch 'feature-current-directory-per-drive' of github.com:PegasusPlusUS/nushell into feature-current-directory-per-drive 2024-11-19 09:37:25 -08:00
252af5ed80 Chances drop 2024-11-19 06:31:56 -08:00
a84a859755 PWD per drive 2024-11-19 04:55:15 -08:00
e48daf8da2 PWD per drive 2024-11-19 04:12:31 -08:00
2a216ea363 CWDperDrive 2024-11-18 20:42:45 -08:00
9ec152d06d DriverPwdMap 2024-11-18 18:35:36 -08:00
e6f55da080 Bump to dev version 0.100.1 (#14328) 2024-11-14 10:04:39 +01:00
c9409a2edb Bump version to 0.100.0 (#14312)
<!--
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.
-->

Bump version to `0.100.0`

# User-Facing Changes

The new release `v0.100.0` is coming...
2024-11-12 22:22:38 +02:00
f061c9a30e Bump to 0.99.2 (#14136) 2024-10-20 23:12:41 +02:00
59d6dee3b3 Bump to version 0.99.1 (#14100)
Post-release patch bump.
2024-10-16 21:23:37 -05:00
91ff57faa7 Bump to version 0.99.0 (#14094)
<!--
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.
-->

# 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 toolkit.nu; toolkit test stdlib"` 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-10-15 22:01:08 +03:00
bcb7ef48b6 Reduce duplication in history path construction (#13475)
# Description
Currently there is a bit of chaos regarding construction of history file
paths. Various pieces of code across a number of crates reimplement the
same/similar logic:
- There is `get_history_path`, but it requires a directory parameter (it
really just joins it with a file name).
- Some places use a const for the directory parameter, others use a
string literal - in all cases the value seems to be `"nushell"`.
- Some places assume the `"nushell"` value, other plumb it down from
close to the top of the call stack.
- Some places use a constant for history file names while others assume
it.

This PR tries to make it so that the history/config path format is
defined in a single places and so dependencies on it are easier to
follow:
- It removes `get_history_path` and adds a `file_path` method to
`HistoryConfig` instead (an extra motivation being, this is a convenient
place that can be used from all creates that need a history file path)
- Adds a `nu_config_dir` function that returns the nushell configuration
directory.
- Updates existing code to rely on the above, effectively removing
duplicate uses of `"nushell"` and `NUSHELL_FOLDER` and assumptions about
file names associated with different history formats

# User-Facing Changes
None
2024-10-11 07:51:50 -05:00
1a081c09de Bump version to 0.98.1 (#13896) 2024-09-22 12:41:44 +08:00
6e1e824473 Bump version to 0.98.0 (#13865) 2024-09-18 00:48:46 -07:00
6600b3edfb Expand multiple dots in path in completions (#13725)
# Description
This is my first PR, and I'm looking for feedback to help me improve! 

This PR fixes #13380 by expanding the path prior to parsing it.
Also I've removed some unused code in
[completion_common.rs](84e92bb02c/crates/nu-cli/src/completions/completion_common.rs
)
# User-Facing Changes

Auto-completion for "cd .../" now works by expanding to "cd ../../". 

# Tests + Formatting

Formatted and added 2 tests for triple dots in the middle of a path and
at the end.
Also added a test for the expand_ndots() function.
2024-09-09 14:39:18 -04:00
84e1ac27e5 Setup global cargo lint configuration (#13691)
# Description
`cargo` somewhat recently gained the capability to store `lints`
settings for the crate and workspace, that can override the defaults
from `rustc` and `clippy` lints. This means we can enforce some lints
without having to actively pass them to clippy via `cargo clippy -- -W
...`. So users just forking the repo have an easier time to follow
similar requirements like our CI.

## Limitation

An exception that remains is that those lints apply to both the primary
code base and the tests. Thus we can't include e.g. `unwrap_used`
without generating noise in the tests. Here the setup in the CI remains
the most helpful.

## Included lints

- Add `clippy::unchecked_duration_subtraction` (added by #12549)
# User-Facing Changes
Running `cargo clippy --workspace` should be closer to the CI. This has
benefits for editor configured runs of clippy and saves you from having
to use `toolkit` to be close to CI in more cases.
2024-08-28 23:37:17 +02:00
e211b7ba53 Bump version to 0.97.2 (#13666) 2024-08-22 11:36:32 +02:00
60769ac1ba Bump version to 0.97.1 (#13659)
# Description

Bump version to `0.97.1`, which will be the actual next major release.
(`0.97.0` had a bug.)
2024-08-20 20:21:12 -07:00
d667b3c0bc bumped version number to 0.97 (#13655) 2024-08-20 16:28:19 -07:00
ae5fed41ed Path migration part 3: $nu paths (#13368)
# Description
Part 3 of replacing `std::path` types with `nu_path` types added in
#13115. This PR targets the paths listed in `$nu`. That is, the home,
config, data, and cache directories.
2024-08-01 10:16:31 +02:00