nushell/CONTRIBUTING.md
nibon7 ad7522bba0
Use string interpolation to construct log file path (#6365)
Signed-off-by: nibon7 <nibon7@163.com>

Signed-off-by: nibon7 <nibon7@163.com>
2022-08-19 20:06:45 -05:00

1.8 KiB

Contributing

Welcome to Nushell!

To get live support from the community see our Discord, Twitter or file an issue or feature request here on GitHub!

Developing

Setup

Nushell requires a recent Rust toolchain and some dependencies; refer to the Nu Book for up-to-date requirements. After installing dependencies, you should be able to clone+build Nu like any other Rust project:

git clone https://github.com/nushell/nushell
cd nushell
cargo build

Useful Commands

  • Build and run Nushell:

    cargo run
    
  • Build and run with extra features. Currently extra features include dataframes and sqlite database support.

    cargo run --features=extra
    
  • Run Clippy on Nushell:

    cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect
    
  • Run all tests:

    cargo test --workspace --features=extra
    
  • Run all tests for a specific command

    cargo test --package nu-cli --test main -- commands::<command_name_here>
    
  • Check to see if there are code formatting issues

    cargo fmt --all -- --check
    
  • Format the code in the project

    cargo fmt --all
    

Debugging Tips

  • To view verbose logs when developing, enable the trace log level.

    cargo run --release --features=extra -- --log-level trace
    
  • To redirect trace logs to a file, enable the --log-target file switch.

    cargo run --release --features=extra -- --log-level trace --log-target file
    open $"($nu.temp-path)/nu-($nu.pid).log"