FEATURE: write better errors for error make and complete the doc#8511
Merged
fdncred merged 10 commits intonushell:mainfrom Mar 22, 2023
Merged
FEATURE: write better errors for error make and complete the doc#8511fdncred merged 10 commits intonushell:mainfrom
error make and complete the doc#8511fdncred merged 10 commits intonushell:mainfrom
Conversation
This commit avoids duplicate code between the two branches of `error make` depending on the value of `--unspanned`.
- when `$.label` is set but not `$.label.text` - when `$.label.start` is set but not `$.label.end` - when `$.label.end` is set but not `$.label.start` - when `$.msg` is not set
This commit allows to narrow down the "format error" span to the minimal part of the format record to help the user the most.
This commit aims at regrouping all the error format matches, to the bottom, for easier readability and avoid mixing these errors with the actual working branches.
This commit makes clippy happy.
- the first one is just a simple `error make` call, without any command definition - the second one calls the command defined with a fishy argument
This call does not bring anything as the "ShellError" results do not print anything.
These are the "simple" examples that do not require commands or more complex structures.
Member
Author
|
even with a |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8511 +/- ##
==========================================
- Coverage 68.52% 68.14% -0.38%
==========================================
Files 621 622 +1
Lines 100124 100589 +465
==========================================
- Hits 68608 68548 -60
- Misses 31516 32041 +525
|
Member
Author
|
well glad it passes in the CI 😌 👀 |
Contributor
|
thanks |
This was referenced Apr 1, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
this PR
ErrorMake::runto avoid duplicate branches depending on the value of--unspannederror makecall, without any command definition$format.labelto better explain why the format is badUser-Facing Changes
users have now the following help
and the following error messages when the error format is bad https://asciinema.org/a/568107 🥳
Tests + Formatting
cargo fmt --allcargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectcargo test --workspace=> the tests do not pass but they do not pass on latest
maineither => i shouldcargo clean, but that's an expensive operation on my machine...After Submitting
the documentation would have to be regenerated over on the website