-
Notifications
You must be signed in to change notification settings - Fork 7
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
refactor and polish the source code of the library #29
Merged
amtoine
merged 15 commits into
nushell:main
from
amtoine:refactor/polish-the-source-code-of-the-library
Jun 16, 2023
Merged
refactor and polish the source code of the library #29
amtoine
merged 15 commits into
nushell:main
from
amtoine:refactor/polish-the-source-code-of-the-library
Jun 16, 2023
Commits on Jun 16, 2023
-
rename the library into
nu_formatter
the goal of this commit is to make a clear distinction between the library which does all the heavy lifting and the binary application which mainly just parses the arguments and calls the library. because i think the application is clearly called `nufmt` i propose here to change the name of the library to `nu_formatter`. i also thought about `nufmt_lib`! this has the huge benefit of making two separate items in the `cargo doc` instead of two with the same `nufmt` name :/ ``` cargo doc --document-private-items --bin nufmt --open ``` directly opens the doc on the application page with the help and the usage, which i find bette :)
Configuration menu - View commit details
-
Copy full SHA for cb90243 - Browse repository at this point
Copy the full SHA cb90243View commit details -
link the
main.rs
doc to the READMEthis commit is here to make the maintainance of the doc easier: change the README and bam, the doc of the `nufmt` binary is up-to-date!
Configuration menu - View commit details
-
Copy full SHA for d172e01 - Browse repository at this point
Copy the full SHA d172e01View commit details -
otherwise, warnings from the documentation and the benchmarks for instance are not seen when running the CI or `toolkit clippy` :o we also make sure we use the same clippy command in the toolkit.
Configuration menu - View commit details
-
Copy full SHA for e662352 - Browse repository at this point
Copy the full SHA e662352View commit details -
use log instead of print except with formatting a string
when formatting a string from stdin we need to return the result directly to stdout.
Configuration menu - View commit details
-
Copy full SHA for e8dd93a - Browse repository at this point
Copy the full SHA e8dd93aView commit details -
in order to have a slice from `cli.files`, i think `cli.files[..]`, i.e. the whole slice from `cli.files`, is easier to work with than `&*cli.files` and does not require any additional comment.
Configuration menu - View commit details
-
Copy full SHA for 5b5f117 - Browse repository at this point
Copy the full SHA 5b5f117View commit details -
implement the "windows newline" trick
because on windows we add `\r\n` and only `\n` on linux, we can just conditionally add `\r` when on windows and then always add `\n`.
Configuration menu - View commit details
-
Copy full SHA for d4bb23a - Browse repository at this point
Copy the full SHA d4bb23aView commit details -
use a more expressive exit_code enum
this commit also removes the `Result` and `Ok` because there is no such error at all in `nu_formatter` for now.
Configuration menu - View commit details
-
Copy full SHA for eae1b46 - Browse repository at this point
Copy the full SHA eae1b46View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0dbb734 - Browse repository at this point
Copy the full SHA 0dbb734View commit details -
Configuration menu - View commit details
-
Copy full SHA for 880ecc1 - Browse repository at this point
Copy the full SHA 880ecc1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 98324ec - Browse repository at this point
Copy the full SHA 98324ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for c183e04 - Browse repository at this point
Copy the full SHA c183e04View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13b91dc - Browse repository at this point
Copy the full SHA 13b91dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3433524 - Browse repository at this point
Copy the full SHA 3433524View commit details -
fix the visibility of
nu_formatter
items- `trim_ascii_whitespaces` is never used outside `formatting` - the `formatting` commands are only used internally
Configuration menu - View commit details
-
Copy full SHA for fd032a0 - Browse repository at this point
Copy the full SHA fd032a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for a43cc16 - Browse repository at this point
Copy the full SHA a43cc16View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.