Skip to content

Upgrade rust and dependencies - #234

Closed
Sha1rholder wants to merge 7 commits into
nushell:mainfrom
Sha1rholder:upgrade-dependencies
Closed

Sha1rholder wants to merge 7 commits into
nushell:mainfrom
Sha1rholder:upgrade-dependencies

Conversation

@Sha1rholder

@Sha1rholder Sha1rholder commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Description of changes

Update rust and dependencies

Relevant Issues

Closes #214

@Sha1rholder

Copy link
Copy Markdown
Contributor Author

Nushell 0.116.0 removed some deprecated dependencies, so now it's a good time to continue working on #215 #216. I haven't dealt with the tests yet. For now it just compiles.

@fdncred

fdncred commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

looks like you need to rebase on main to get rid of the merge conflict

@Sha1rholder

Copy link
Copy Markdown
Contributor Author

@fdncred Nushell's AST parser has changed, and it added 5 test failures (not including the "special cases" in ground_truth.rs), so the CI is no longer passing. I think it might be better to refactor the test-related code first before fixing nufmt.

My rough idea is something like this:

tests/fixtures/
├ change/
│   ├ input/
│   ├ (git ignored) unexpected/
│   ├ expected/
│   └ (git ignored) not_idempotent/
├ consistent/
└ (git ignored) not_idempotent/
image

On each test run:

  • Check that the file lists in change/input/ and change/expected/ match exactly.
  • Format each Nushell file in consistent/ once. If a file changes, write the formatted result to not_idempotent/. This verifies the idempotency of the Nushell files in consistent/.
  • Similarly, format each Nushell file in change/expected/ once. If a file changes, write the formatted result to change/not_idempotent/.
  • Skip any Nushell files whose expected output has already been shown by the previous step to be non-idempotent. For the remaining files, format each file in change/input/ once and compare the result with the corresponding file in change/expected/. If they differ, write the generated result to change/unexpected/.

This way, each Nushell script will be and only will be formatted once during the test run, while still verifying correctness and idempotency. It should also make ground_truth.rs much shorter, and make test failures easier to inspect than they are now.

Using git mv for the refactor won't produce a huge diff.

What do you think?

@fdncred

fdncred commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

ok

@Sha1rholder
Sha1rholder marked this pull request as ready for review September 30, 2026 22:22
@Sha1rholder

Copy link
Copy Markdown
Contributor Author

@fdncred It's ready for review.

As for refactoring tests/, I think my previous design was bad. I need to look into it some more.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The upgrade masks a match-pattern formatting regression and leaves the dependency updater unable to keep all Nushell crates aligned.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Upgrades nufmt to Rust 2024 and Nushell 0.116, adapting APIs, dependencies, tooling, and formatting fixtures.

Changes:

  • Updates Rust/Nushell dependencies and lockfiles.
  • Adapts formatter code to updated APIs and output behavior.
  • Refreshes Nix configuration, documentation, and update tooling.
File Description
Cargo.toml Updates edition and dependencies.
Cargo.lock Refreshes resolved dependencies.
README.md Updates Nushell badge.
flake.nix Moves to unstable nixpkgs and adjusts platforms.
flake.lock Updates the nixpkgs pin.
scripts/​update-nushell-version Modernizes dependency-update commands.
benches/​file-format-bench.rs Applies updated Rust formatting.
src/​main.rs Applies Rust 2024 formatting.
src/​lib.rs Reformats debug logging.
src/​formatting/​repair.rs Adapts parse errors and let chains.
src/​formatting/​mod.rs Modernizes conditional control flow.
src/​formatting/​expressions.rs Modernizes expression conditions.
src/​formatting/​engine.rs Reorders imports.
src/​formatting/​comments.rs Modernizes comment handling.
src/​formatting/​collections.rs Modernizes match-pattern handling.
src/​formatting/​calls.rs Handles the new completion variant.
src/​formatting/​blocks.rs Modernizes block-spacing conditions.
tests/​fixtures/​expected/​nested_structures.nu Updates nested formatting output.
tests/​fixtures/​expected/​nested_closure_indentation_normalized_issue159.nu Updates nested try formatting.
tests/​fixtures/​expected/​multiline_pipeline.nu Updates record pipeline layout.
tests/​fixtures/​expected/​identifier_safe_match_patterns_unquoted_issue157.nu Changes match-pattern expectations.
tests/​fixtures/​expected/​def_with_pipeline_double_parens_issue82.nu Updates nested block layout.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/update-nushell-version
Comment on lines +2 to +4
"allow" => "ok"
"deny" => "blocked"
"ask" => "queued"
@Sha1rholder
Sha1rholder marked this pull request as draft October 1, 2026 00:37
Sha1rholder and others added 2 commits October 1, 2026 08:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Sha1rholder

Copy link
Copy Markdown
Contributor Author

should be rewritten after #237

@Sha1rholder Sha1rholder closed this Oct 6, 2026
@Sha1rholder
Sha1rholder deleted the upgrade-dependencies branch October 6, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade nufmt dependencies / toolchain

3 participants