-
Notifications
You must be signed in to change notification settings - Fork 213
Add spec for strict-raw-types #521
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
Conversation
@@ -0,0 +1,125 @@ | |||
# Strict raw types static analysis option |
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.
As per comments in the strict inference review, consider moving this to resources/type-system? Or alternatively add a resources/strict-checks/ directory?
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.
Done.
|
||
```yaml | ||
analyzer: | ||
langauge: |
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.
should be language
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.
Done.
## Enabling strict raw types | ||
|
||
To enable strict raw types, set the `strict-raw-types` option to `true`, under | ||
the Analyzer's `language` section: |
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.
Is there a command line option version of this flag?
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.
No, there isn't presently. I can't find the review comment, but I think @bwilkerson recommended just wiring an analysis option, because we're primarily dogfooding this internally, where it will exclusively be wired via an analysis options file.
I don't think there was an intention to never add a command-line flag, it was just simpler not to for now.
} | ||
``` | ||
|
||
The devloper likely does not realize that the parameter `e` of the callback is |
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.
devloper => developer
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.
Done.
Reporting strict raw types encourages developers to fill in omitted type | ||
arguments, hopefully with something other than `dynamic`. In cases where the | ||
only good type is `dynamic`, then including it as an explicit type argument | ||
avoids the raw type. |
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.
Perhaps: "avoids the raw type, and makes the dynamic behavior more explicit in the code."
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 like it. Done.
Fixes #516