-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(config): Propagate validation errors
When `flatten`ing an `Option`, all errors are silenced, making the value `None`, not just "this field doesn't exist". The easiest way around this was to not use `Option`. Not too confident in all of the changes but tests pass? Fixes #881
- Loading branch information
Showing
4 changed files
with
33 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
27 changes: 12 additions & 15 deletions
27
crates/typos-cli/tests/cmd/extend-ignore-identifiers-re-bad.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
bin.name = "typos" | ||
status.code = 2 | ||
status.code = 78 | ||
stdin = "" | ||
stdout = """ | ||
error: `hello` should be `goodbye` | ||
--> ./file.ignore:1:1 | ||
| | ||
1 | hello | ||
| ^^^^^ | ||
| | ||
error: `hello` should be `goodbye` | ||
--> ./file.fail:1:1 | ||
| | ||
1 | hello | ||
| ^^^^^ | ||
| | ||
stdout = "" | ||
stderr = """ | ||
TOML parse error at line 7, column 1 | ||
| | ||
7 | [type.ignore] | ||
| ^[..] | ||
regex parse error: | ||
(he.* | ||
^ | ||
error: unclosed group | ||
""" | ||
stderr = "" |