-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
chore: Add basic mypy check (no behavior change) #2488
Conversation
@@ -1,3 +0,0 @@ | |||
# flake8: noqa | |||
|
|||
from samtranslator.translator import add_default_parameter_values |
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.
Explanation: this file is not used, and samtranslator.translator
doesn't have add_default_parameter_values
@@ -179,9 +181,7 @@ def _parse(self, globals_dict): | |||
|
|||
globals = {} | |||
if not isinstance(globals_dict, dict): | |||
raise InvalidGlobalsSectionException( | |||
self._KEYWORD, "It must be a non-empty dictionary".format(self._KEYWORD) |
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.
Explanation: .format()
is noop because there are not %s
in the string template.
@@ -607,7 +607,7 @@ def _validate_dlq(self): | |||
if not self.DeadLetterQueue.get("Type") or not self.DeadLetterQueue.get("TargetArn"): | |||
raise InvalidResourceException( | |||
self.logical_id, | |||
"'DeadLetterQueue' requires Type and TargetArn properties to be specified.".format(valid_dlq_types), |
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.
Explanation: .format()
is noop because there are not %s
in the string template.
@@ -20,11 +20,11 @@ | |||
|
|||
_CORS_WILDCARD = "*" | |||
CorsProperties = namedtuple( | |||
"_CorsProperties", ["AllowMethods", "AllowHeaders", "AllowOrigins", "MaxAge", "ExposeHeaders", "AllowCredentials"] |
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.
Explanation: first parameter needs to be consistent with assigned type name. the literal _CorsProperties
is only a type hint name, not used anywhere in our codebase.
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.
Great! 🚢
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.
yay 🙌
Issue #, if available:
Description of changes:
Have bare minimal type check and we can enable more checks in the future to ensure code quality and correctness.
Description of how you validated changes:
No behavior changes have been made in this PR.
Checklist:
make pr
passesExamples?
Please reach out in the comments, if you want to add an example. Examples will be
added to
sam init
through https://github.com/awslabs/aws-sam-cli-app-templates/By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.