Skip to content

Commit 9f6e8f4

Browse files
authored
Update E2015 to split defaults on comma (#3466)
1 parent 8a40ff1 commit 9f6e8f4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: src/cfnlint/rules/parameters/Default.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import regex as re
77

88
from cfnlint._typing import RuleMatches
9+
from cfnlint.helpers import VALID_PARAMETER_TYPES_LIST
910
from cfnlint.rules import CloudFormationLintRule, RuleMatch
1011
from cfnlint.template import Template
1112

@@ -127,8 +128,8 @@ def match_default_value(self, paramname, paramvalue, default_value):
127128
matches.extend(self.check_max_length(default_value, max_length, path))
128129
return matches
129130

130-
def is_cdl(self, paramvalue):
131-
return paramvalue.get("Type") == "CommaDelimitedList"
131+
def is_list(self, paramvalue):
132+
return paramvalue.get("Type") in VALID_PARAMETER_TYPES_LIST
132133

133134
def match(self, cfn: Template) -> RuleMatches:
134135
matches = []
@@ -137,7 +138,7 @@ def match(self, cfn: Template) -> RuleMatches:
137138
param_cdl_matches = []
138139
param_matches = []
139140
default_value = paramvalue.get("Default")
140-
if default_value is not None and self.is_cdl(paramvalue):
141+
if default_value is not None and self.is_list(paramvalue):
141142
comma_delimited_default_values = [
142143
x.strip() for x in default_value.split(",")
143144
]
@@ -146,7 +147,7 @@ def match(self, cfn: Template) -> RuleMatches:
146147
self.match_default_value(paramname, paramvalue, value)
147148
)
148149

149-
if param_cdl_matches or not self.is_cdl(paramvalue):
150+
if param_cdl_matches or not self.is_list(paramvalue):
150151
param_matches.extend(
151152
self.match_default_value(paramname, paramvalue, default_value)
152153
)

0 commit comments

Comments
 (0)