Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file lookup in parser keywords; Refactor nu_repl #6185

Merged
merged 2 commits into from Jul 29, 2022

Conversation

kubouch
Copy link
Contributor

@kubouch kubouch commented Jul 29, 2022

Description

Fixes the logic used to look up files in parser keywords which was broke NU_LIB_DIRS.

In order to test it, I had to use the nu_repl() simulator. However, I discovered that nu_repl() changes directory for the whole test binary which would cause a lot of other tests fail. To address that, I moved nu_repl() to be a testbin which means it will run in its own Nushell instance. This means, it's possible to run nu --testbin=nu_repl line1 line2 and it would be executed as if you typed

> line1

> line2

in the Nushell REPL.

Fixes #6184

Tests

Make sure you've done the following:

  • Add tests that cover your changes, either in the command examples, the crate/tests folder, or in the /tests folder.
  • Try to think about corner cases and various ways how your changes could break. Cover them with tests.
  • If adding tests is not possible, please document in the PR body a minimal example with steps on how to reproduce so one can verify your change works.

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 --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo test --workspace --features=extra to check that all the tests pass

@kubouch kubouch force-pushed the fix-nu-lib-dirs branch 7 times, most recently from c607ea3 to 857496b Compare July 29, 2022 15:04
@kubouch kubouch marked this pull request as draft July 29, 2022 15:06
@kubouch kubouch force-pushed the fix-nu-lib-dirs branch 4 times, most recently from 96251da to d982416 Compare July 29, 2022 17:07
@kubouch kubouch changed the title Fix file lookup in parser keywords Fix file lookup in parser keywords; Refactor nu_repl Jul 29, 2022
@kubouch kubouch marked this pull request as ready for review July 29, 2022 19:01
@kubouch kubouch merged commit d6f4189 into nushell:main Jul 29, 2022
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.

NU_LIB_DIRS no longer working
1 participant