Deprecate default check#626
Merged
rafaelfranca merged 2 commits intorails:masterfrom Nov 15, 2019
Merged
Conversation
Choms
suggested changes
Sep 25, 2018
Contributor
Choms
left a comment
There was a problem hiding this comment.
left you a couple comments, rest of the code looks good 👍
| raise ArgumentError, err | ||
| elsif @check_default_type == nil | ||
| Thor.deprecation_warning "#{err}.\n" + | ||
| 'This will be rejected in the future unless you explicitly pass the options `check_default_type: false`.' |
Contributor
There was a problem hiding this comment.
I'd rephrase that as:
'This will be rejected in the future unless you explicitly pass the options `check_default_type: false` or define `allow_incompatible_default_type!` in your code'
Contributor
Author
There was a problem hiding this comment.
As above, but "or callallow_..."
| it "allows incompatible types if `check_default_type: false` is given" do | ||
| expect do | ||
| Class.new(Thor) do | ||
| allow_incompatible_default_type! |
Contributor
There was a problem hiding this comment.
Remove this line so the second test makes sense (else it's equivalent to the previous one)
Contributor
Author
There was a problem hiding this comment.
Oops, indeed. And it revealed a bug that was already there whereby an explicit setting was always overwritten by a merge being inverted. Fixed
c15c5c6 to
4fb8401
Compare
This reverts commit a88ea56792c9a40d803f025ffcb63e8ae35bf5ff.
…cit option given [rails#621]
4fb8401 to
7d199c0
Compare
Choms
approved these changes
Oct 22, 2018
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.
This issues a deprecation warning if one specifies an incompatible default value without either calling
allow_incompatible_default_type!or passingcheck_default_type: false.See discussion in #621