Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -69,53 +69,28 @@ disable=
W0613, # Unused argument %r
W0640, # Cell variable %s defined in loop A variable used in a closure is defined in a loop
R0902, # Too many instance attributes (%s/%s)
# R0903, # Too few public methods (%s/%s)
R0913, # Too many arguments (%s/%s)
W0703, # Catching too general exception %s
R0904, # Too many public methods (%s/%s)
R0914, # Too many local variables (%s/%s)
R0915, # Too many statements
C0415, # Import outside toplevel (%s) Used when an import statement is used anywhere other than the module toplevel. Move this import to the top of the file.
C0115, # missing-class-docstring
# below are docstring lint rules, in order to incrementally improve our docstring while
# without introduce too much effort at a time, we exclude most of the docstring lint rules.
# We will remove them one by one.
# W9005, # "%s" has constructor parameters documented in class and __init__
W9006, # "%s" not documented as being raised
# W9008, # Redundant returns documentation
# W9010, # Redundant yields documentation
W9011, # Missing return documentation
W9012, # Missing return type documentation
# W9013, # Missing yield documentation
# W9014, # Missing yield type documentation
# W9015, # "%s" missing in parameter documentation
W9016, # "%s" missing in parameter type documentation
# W9017, # "%s" differing in parameter documentation
# W9018, # "%s" differing in parameter type documentation
# W9019, # "%s" useless ignored parameter documentation
# W9020, # "%s" useless ignored parameter type documentation
# Constant name style warnings. We will remove them one by one.
C0103, # Class constant name "%s" doesn't conform to UPPER_CASE naming style ('([^\\W\\da-z][^\\Wa-z]*|__.*__)$' pattern) (invalid-name)
# New recommendations, disable for now to avoid introducing behaviour changes.
R1729, # Use a generator instead '%s' (use-a-generator)
# R1732, # Consider using 'with' for resource-allocating operations (consider-using-with)
# This applies to CPython only.
# I1101, # Module 'math' has no 'pow' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)
# Added to allow linting. Need to work on removing over time
R0801, # dupilcated code
R0401, # Cyclic import
C0411, # import ordering
W9015, # missing parameter in doc strings
# W0612, # unused variable
R0205, # useless-object-inheritanc
C0301, # line to long
R0201, # no self use, method could be a function
C0114, # missing-module-docstring
W1202, # Use lazy % formatting in logging functions (logging-format-interpolation)
E1101, # No member
W0622, # Redefining built-in 'property' (redefined-builtin)
# W0611, # unused imports
# W0231, # super not called
W0212, # protected-access
W0201, # attribute-defined-outside-init
R1725, # Consider using Python 3 style super() without arguments (super-with-arguments)
Expand All @@ -126,8 +101,6 @@ disable=
W0223, # abstract-method
W0107, # unnecessary-pass
W0707, # raise-missing-from
# R1720, # no-else-raise
# W0621, # redefined-outer-name
E0203, # access-member-before-definition
W0221, # arguments-differ
R1710, # inconsistent-return-statements
Expand All @@ -136,32 +109,14 @@ disable=
W0105, # String statement has no effect (pointless-string-statement)
C0206, # Consider iterating with .items() (consider-using-dict-items)
W9008, # Redundant returns documentation (redundant-returns-doc)
# E0602, # undefined-variable
C0112, # empty-docstring
C0116, # missing-function-docstring
# C0200, # consider-using-enumerate
# R5501, # Consider using "elif" instead of "else if" (else-if-used)
W9017, # differing-param-doc
W9018, # differing-type-doc
W0511, # fixme
# C0325, # superfluous-parens
# R1701, # consider-merging-isinstance
C0302, # too-many-lines
# C0303, # trailing-whitespace
# R1721, # unnecessary-comprehension
# C0121, # singleton-comparison
# E1305, # too-many-format-args
# R1724, # no-else-continue
# E0611, # no-name-in-module
W9013, # missing-yield-doc
W9014, # missing-yield-type-doc
C0201, # consider-iterating-dictionary
# W0237, # arguments-renamed
# R1718, # consider-using-set-comprehension
# R1723, # no-else-break
E1133, # not-an-iterable
E1135, # unsupported-membership-test
# R1705, # no-else-return


[REPORTS]
Expand Down
2 changes: 1 addition & 1 deletion samtranslator/intrinsics/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, parameters, supported_intrinsics=None):
)

if not isinstance(supported_intrinsics, dict) or not all(
[isinstance(value, Action) for value in supported_intrinsics.values()]
(isinstance(value, Action) for value in supported_intrinsics.values())
):
raise TypeError("supported_intrinsics argument must be intrinsic names to corresponding Action classes")

Expand Down
4 changes: 2 additions & 2 deletions samtranslator/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _generate_resource_dict(self):
resource_dict.update(self.resource_attributes)

properties_dict = {}
for name in self.property_types:
for name in self.property_types.keys():
value = getattr(self, name)
if value is not None:
properties_dict[name] = value
Expand All @@ -246,7 +246,7 @@ def __setattr__(self, name, value):
:param value: the value of the attribute to be set
:raises InvalidResourceException: if an invalid property is provided
"""
if name in self._keywords or name in self.property_types:
if name in self._keywords or name in self.property_types.keys():
return super(Resource, self).__setattr__(name, value)

raise InvalidResourceException(
Expand Down
2 changes: 2 additions & 0 deletions samtranslator/model/api/api_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ def _construct_stage(self, deployment, swagger, redeploy_restapi_parameters):
return stage

def _construct_api_domain(self, rest_api, route53_record_set_groups):
# pylint: disable=duplicate-code
"""
Constructs and returns the ApiGateway Domain and BasepathMapping
"""
Expand Down Expand Up @@ -574,6 +575,7 @@ def _construct_record_sets_for_domain(self, domain):
return recordset_list

def _construct_alias_target(self, domain):
# pylint: disable=duplicate-code
alias_target = {}
route53 = domain.get("Route53")
target_health = route53.get("EvaluateTargetHealth")
Expand Down
2 changes: 1 addition & 1 deletion samtranslator/model/apigatewayv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _validate_lambda_authorizer(self):
)
headers = self.identity.get("Headers")
if headers:
if not isinstance(headers, list) or any([not isinstance(header, str) for header in headers]):
if not isinstance(headers, list) or any((not isinstance(header, str) for header in headers)):
raise InvalidResourceException(
self.api_logical_id,
self.name + " Lambda Authorizer property identity's 'Headers' is of invalid type.",
Expand Down
1 change: 1 addition & 0 deletions samtranslator/model/eventsources/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ def _get_permission(self, resources_to_link, stage, suffix):
return self._construct_permission(resources_to_link["function"], source_arn=source_arn, suffix=suffix)

def _add_swagger_integration(self, api, function, intrinsics_resolver):
# pylint: disable=duplicate-code
"""Adds the path and method for this Api event source to the Swagger body for the provided RestApi.

:param model.apigateway.ApiGatewayRestApi rest_api: the RestApi to which the path and method should be added.
Expand Down
205 changes: 0 additions & 205 deletions samtranslator/model/function_policies.py

This file was deleted.

2 changes: 1 addition & 1 deletion samtranslator/plugins/globals/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(self, template):
:param dict template: SAM template to be parsed
"""
self.supported_resource_section_names = [
x.replace(self._RESOURCE_PREFIX, "") for x in self.supported_properties.keys()
x.replace(self._RESOURCE_PREFIX, "") for x in self.supported_properties
]
# Sort the names for stability in list ordering
self.supported_resource_section_names.sort()
Expand Down
Loading