-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
warning cli: tweak single-letter warning deprecation #10312
Merged
gasche
merged 8 commits into
ocaml:trunk
from
Octachron:tuned_single_letter_deprecation
Apr 15, 2021
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7921b9a
cli: tweak warning cli deprecation
Octachron 8518de1
review
Octachron 1e4a42c
review: reorganize code and fix a bug
Octachron 1f4c469
review: improved example printing
Octachron 478299a
review: implementation remnant
Octachron 47c38f2
Updated changes for nuanced warning letter deprecation
Octachron 8f5482d
review: tweak comment
Octachron c21fa45
warning deprecation: add example in the testsuite
Octachron File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(* TEST | ||
* expect | ||
*) | ||
|
||
(** Deprecated sequences of unsigned letters *) | ||
|
||
[@@@warning "fragile-math"] | ||
[%%expect {| | ||
Line 3, characters 0-27: | ||
3 | [@@@warning "fragile-math"] | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Alert ocaml_deprecated_cli: Setting a warning with a sequence of lowercase or uppercase letters, | ||
like 'ath', is deprecated. | ||
Use the equivalent signed form: -f-r-a-g-i-l-e-m-a-t-h. | ||
Hint: Enabling or disabling a warning by its mnemonic name requires a + or - prefix. | ||
Hint: Did you make a spelling mistake when using a mnemonic name? | ||
|}] | ||
|
||
[@@@warning "ab-cdg+efh"] | ||
[%%expect {| | ||
Line 1, characters 0-25: | ||
1 | [@@@warning "ab-cdg+efh"] | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Alert ocaml_deprecated_cli: Setting a warning with a sequence of lowercase or uppercase letters, | ||
like 'fh', is deprecated. | ||
Use the equivalent signed form: -a-b-c-d-g+e-f-h. | ||
Hint: Enabling or disabling a warning by its mnemonic name requires a + or - prefix. | ||
|}] | ||
|
||
|
||
(** -w "a+10..." and -w "A-10..." are still supported *) | ||
[@@@warning "a+1..20+50"] | ||
[%%expect {| | ||
|}] | ||
|
||
[@@@warning "A-3..14-56"] | ||
[%%expect {| | ||
|}] |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fond of the
[] :: _
case:assert (examples <> [])
below.So I would be in favor of dropping that subcase completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, this was a remnant of the previous iteration on the warning message.