-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add Typing/MacroCallArgumentTypeRestriction
#521
Add Typing/MacroCallArgumentTypeRestriction
#521
Conversation
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.
LGTM. Nice one
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.
Aside of the review comments, I'm missing here a default_value
rule option, which would exclude the cases where the default value is given.
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Also, I believe sth like a |
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Typing/MacroCallVarTypeRestriction
Typing/MacroCallArgumentTypeRestriction
spec/ameba/rule/typing/macro_call_argument_type_restriction_spec.cr
Outdated
Show resolved
Hide resolved
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
spec/ameba/rule/typing/macro_call_argument_type_restriction_spec.cr
Outdated
Show resolved
Hide resolved
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
spec/ameba/rule/typing/macro_call_argument_type_restriction_spec.cr
Outdated
Show resolved
Hide resolved
spec/ameba/rule/typing/macro_call_argument_type_restriction_spec.cr
Outdated
Show resolved
Hide resolved
spec/ameba/rule/typing/macro_call_argument_type_restriction_spec.cr
Outdated
Show resolved
Hide resolved
spec/ameba/rule/typing/macro_call_argument_type_restriction_spec.cr
Outdated
Show resolved
Hide resolved
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
At this point the
|
I don't see this as an issue. It accepts
This series of PRs is explicitly about removing this inference, so I disagree and think that the |
I agree with @nobodywasishere on keeping record in the list. But would it make sense to default record Task,
cmd = "ameba",
args = [] of String and we don't have to enforce this by default: record Task,
cmd : String = "ameba",
args : Array(String) = [] of String |
@veelenga That's how I should've done it (and how I did it in the other typing rules), where when enabled, it's the least-restrictive form of the rule, with the option to go more restrictive.
A secondary goal for me is in tooling, where I will probably use this and other rules to enforce types so a language server has an easier time figuring out what the types of things are. |
No description provided.