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: give same order in std help ... as in help ... #9034

Merged
merged 2 commits into from
Apr 28, 2023

Conversation

amtoine
Copy link
Member

@amtoine amtoine commented Apr 28, 2023

Should close on of the points in

Description

before this PR, we had a problem

cargo run -- -c '{
     modules: ((help modules | get name) == (std help modules | get name))
     aliases: ((help aliases | get name) == (std help aliases | get name))
     externs: ((help externs | get name) == (std help externs | get name))
     operators: ((help operators | get name) == (std help operators | get name))
     commands: ((help commands | get name) == (std help commands | get name))
}'

would give

╭───────────┬───────╮
│ modules   │ false │
│ aliases   │ true  │
│ externs   │ true  │
│ operators │ false │
│ commands  │ true  │
╰───────────┴───────╯

this PR removes the name sorting so that the orders are the same between the std implementation and the built-in one.

Note
run the same cargo run command as above and see

╭───────────┬──────╮
│ modules   │ true │
│ aliases   │ true │
│ externs   │ true │
│ operators │ true │
│ commands  │ true │
╰───────────┴──────╯

User-Facing Changes

the operators in std help ... will be sorted just as the built-in help ....

Tests + Formatting

  • 🟢 toolkit fmt
  • 🟢 toolkit clippy
  • toolkit test
  • toolkit test stdlib

After Submitting

$nothing

@amtoine amtoine added the std-library Defining and improving the standard library written in nu and the core Rust ccommands label Apr 28, 2023
@amtoine amtoine requested a review from fdncred April 28, 2023 11:09
@amtoine amtoine self-assigned this Apr 28, 2023
@amtoine amtoine changed the title FIX: give same order in std help operators as in help operators FIX: give same order in std help ... as in help ... Apr 28, 2023
@amtoine amtoine marked this pull request as draft April 28, 2023 11:17
@amtoine amtoine marked this pull request as ready for review April 28, 2023 11:23
@codecov
Copy link

codecov bot commented Apr 28, 2023

Codecov Report

Merging #9034 (2d6be47) into main (4c4c1f6) will increase coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9034      +/-   ##
==========================================
+ Coverage   68.75%   68.76%   +0.01%     
==========================================
  Files         640      640              
  Lines      101433   101433              
==========================================
+ Hits        69737    69749      +12     
+ Misses      31696    31684      -12     

see 1 file with indirect coverage changes

Copy link
Collaborator

@fdncred fdncred left a comment

Choose a reason for hiding this comment

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

I tested it and it looks good. thanks!

@fdncred fdncred merged commit dae4a9b into nushell:main Apr 28, 2023
@amtoine amtoine deleted the fix/stdlib/help-operators-order branch April 28, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
std-library Defining and improving the standard library written in nu and the core Rust ccommands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants