puppet-lint 2.5.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +522 -0
- data/lib/puppet-lint/bin.rb +71 -6
- data/lib/puppet-lint/checkplugin.rb +43 -9
- data/lib/puppet-lint/checks.rb +16 -16
- data/lib/puppet-lint/configuration.rb +134 -134
- data/lib/puppet-lint/data.rb +28 -28
- data/lib/puppet-lint/lexer/string_slurper.rb +138 -140
- data/lib/puppet-lint/lexer/token.rb +188 -190
- data/lib/puppet-lint/lexer.rb +416 -417
- data/lib/puppet-lint/monkeypatches.rb +1 -1
- data/lib/puppet-lint/optparser.rb +5 -1
- data/lib/puppet-lint/plugins/check_classes/arrow_on_right_operand_line.rb +6 -4
- data/lib/puppet-lint/plugins/check_classes/autoloader_layout.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/class_inherits_from_params_class.rb +6 -4
- data/lib/puppet-lint/plugins/check_classes/code_on_top_scope.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/inherits_across_namespaces.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/names_containing_dash.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/names_containing_uppercase.rb +7 -5
- data/lib/puppet-lint/plugins/check_classes/nested_classes_or_defines.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/parameter_order.rb +7 -4
- data/lib/puppet-lint/plugins/check_classes/right_to_left_relationship.rb +5 -3
- data/lib/puppet-lint/plugins/check_classes/variable_scope.rb +15 -13
- data/lib/puppet-lint/plugins/check_comments/slash_comments.rb +9 -7
- data/lib/puppet-lint/plugins/check_comments/star_comments.rb +10 -8
- data/lib/puppet-lint/plugins/check_conditionals/case_without_default.rb +6 -4
- data/lib/puppet-lint/plugins/check_conditionals/selector_inside_resource.rb +5 -3
- data/lib/puppet-lint/plugins/check_documentation/documentation.rb +7 -3
- data/lib/puppet-lint/plugins/check_nodes/unquoted_node_name.rb +15 -11
- data/lib/puppet-lint/plugins/check_resources/duplicate_params.rb +5 -3
- data/lib/puppet-lint/plugins/check_resources/ensure_first_param.rb +8 -5
- data/lib/puppet-lint/plugins/check_resources/ensure_not_symlink_target.rb +11 -8
- data/lib/puppet-lint/plugins/check_resources/file_mode.rb +14 -9
- data/lib/puppet-lint/plugins/check_resources/unquoted_file_mode.rb +11 -6
- data/lib/puppet-lint/plugins/check_resources/unquoted_resource_title.rb +6 -4
- data/lib/puppet-lint/plugins/check_strings/double_quoted_strings.rb +12 -7
- data/lib/puppet-lint/plugins/check_strings/only_variable_string.rb +8 -6
- data/lib/puppet-lint/plugins/check_strings/puppet_url_without_modules.rb +14 -8
- data/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb +11 -7
- data/lib/puppet-lint/plugins/check_strings/single_quote_string_with_variables.rb +11 -6
- data/lib/puppet-lint/plugins/check_strings/variables_not_enclosed.rb +12 -8
- data/lib/puppet-lint/plugins/check_variables/variable_contains_dash.rb +11 -7
- data/lib/puppet-lint/plugins/check_variables/variable_is_lowercase.rb +11 -7
- data/lib/puppet-lint/plugins/check_whitespace/140chars.rb +3 -8
- data/lib/puppet-lint/plugins/check_whitespace/2sp_soft_tabs.rb +10 -8
- data/lib/puppet-lint/plugins/check_whitespace/80chars.rb +3 -8
- data/lib/puppet-lint/plugins/check_whitespace/arrow_alignment.rb +10 -8
- data/lib/puppet-lint/plugins/check_whitespace/hard_tabs.rb +11 -7
- data/lib/puppet-lint/plugins/check_whitespace/line_length.rb +29 -0
- data/lib/puppet-lint/plugins/check_whitespace/trailing_whitespace.rb +13 -7
- data/lib/puppet-lint/plugins.rb +63 -61
- data/lib/puppet-lint/report/github.rb +17 -0
- data/lib/puppet-lint/report/sarif_template.json +63 -0
- data/lib/puppet-lint/tasks/puppet-lint.rb +84 -83
- data/lib/puppet-lint/tasks/release_test.rb +4 -1
- data/lib/puppet-lint/version.rb +1 -1
- data/lib/puppet-lint.rb +27 -12
- data/spec/acceptance/puppet_lint_spec.rb +46 -0
- data/spec/spec_helper.rb +92 -91
- data/spec/spec_helper_acceptance.rb +6 -0
- data/spec/spec_helper_acceptance_local.rb +38 -0
- data/spec/{puppet-lint → unit/puppet-lint}/bin_spec.rb +79 -35
- data/spec/{puppet-lint → unit/puppet-lint}/checks_spec.rb +36 -36
- data/spec/unit/puppet-lint/configuration_spec.rb +88 -0
- data/spec/{puppet-lint → unit/puppet-lint}/data_spec.rb +6 -3
- data/spec/{puppet-lint → unit/puppet-lint}/ignore_overrides_spec.rb +17 -17
- data/spec/{puppet-lint → unit/puppet-lint}/lexer/string_slurper_spec.rb +128 -128
- data/spec/{puppet-lint → unit/puppet-lint}/lexer/token_spec.rb +1 -1
- data/spec/{puppet-lint → unit/puppet-lint}/lexer_spec.rb +653 -671
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/arrow_on_right_operand_line_spec.rb +16 -16
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/autoloader_layout_spec.rb +13 -13
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/class_inherits_from_params_class_spec.rb +3 -3
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/code_on_top_scope_spec.rb +4 -4
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/inherits_across_namespaces_spec.rb +4 -4
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/name_contains_uppercase_spec.rb +10 -10
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/names_containing_dash_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/nested_classes_or_defines_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/parameter_order_spec.rb +9 -9
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/right_to_left_relationship_spec.rb +3 -3
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/variable_scope_spec.rb +25 -25
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_comments/slash_comments_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_comments/star_comments_spec.rb +13 -13
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_conditionals/case_without_default_spec.rb +10 -10
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_conditionals/selector_inside_resource_spec.rb +3 -3
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_documentation/documentation_spec.rb +8 -8
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_nodes/unquoted_node_name_spec.rb +24 -24
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/duplicate_params_spec.rb +9 -9
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/ensure_first_param_spec.rb +19 -19
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/ensure_not_symlink_target_spec.rb +10 -10
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/file_mode_spec.rb +40 -40
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/unquoted_file_mode_spec.rb +20 -20
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/unquoted_resource_title_spec.rb +24 -24
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/double_quoted_strings_spec.rb +27 -27
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/only_variable_string_spec.rb +18 -18
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/puppet_url_without_modules_spec.rb +9 -9
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/quoted_booleans_spec.rb +22 -22
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/single_quote_string_with_variables_spec.rb +2 -2
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/variables_not_enclosed_spec.rb +21 -21
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_variables/variable_contains_dash_spec.rb +6 -6
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_variables/variable_is_lowercase_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/140chars_spec.rb +5 -5
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/2sp_soft_tabs_spec.rb +2 -2
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/80chars_spec.rb +6 -6
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/arrow_alignment_spec.rb +127 -127
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/hard_tabs_spec.rb +7 -7
- data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/trailing_whitespace_spec.rb +15 -15
- data/spec/unit/puppet-lint/puppet-lint_spec.rb +18 -0
- metadata +63 -119
- data/CHANGELOG.md +0 -33
- data/HISTORY.md +0 -1130
- data/spec/puppet-lint/configuration_spec.rb +0 -66
- data/spec/puppet-lint_spec.rb +0 -16
@@ -1,210 +1,208 @@
|
|
1
|
-
class PuppetLint
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
end
|
1
|
+
class PuppetLint::Lexer
|
2
|
+
# Public: Stores a fragment of the manifest and the information about its
|
3
|
+
# location in the manifest.
|
4
|
+
class Token
|
5
|
+
# Public: Returns the Symbol type of the Token.
|
6
|
+
attr_accessor :type
|
7
|
+
|
8
|
+
# Public: Returns the String value of the Token.
|
9
|
+
attr_accessor :value
|
10
|
+
|
11
|
+
# Public: Returns the raw value of the Token.
|
12
|
+
attr_accessor :raw
|
13
|
+
|
14
|
+
# Public: Returns the Integer line number of the manifest text where
|
15
|
+
# the Token can be found.
|
16
|
+
attr_reader :line
|
17
|
+
|
18
|
+
# Public: Returns the Integer column number of the line of the manifest
|
19
|
+
# text where the Token can be found.
|
20
|
+
attr_reader :column
|
21
|
+
|
22
|
+
# Public: Gets/sets the next token in the manifest.
|
23
|
+
attr_accessor :next_token
|
24
|
+
|
25
|
+
# Public: Gets/sets the previous token in the manifest.
|
26
|
+
attr_accessor :prev_token
|
27
|
+
|
28
|
+
# Public: Gets/sets the next code token (skips whitespace, comments,
|
29
|
+
# etc) in the manifest.
|
30
|
+
attr_accessor :next_code_token
|
31
|
+
|
32
|
+
# Public: Gets/sets the previous code tokne (skips whitespace,
|
33
|
+
# comments, etc) in the manifest.
|
34
|
+
attr_accessor :prev_code_token
|
35
|
+
|
36
|
+
# Public: Initialise a new Token object.
|
37
|
+
#
|
38
|
+
# type - An upper case Symbol describing the type of Token.
|
39
|
+
# value - The String value of the Token.
|
40
|
+
# line - The Integer line number where the Token can be found in the
|
41
|
+
# manifest.
|
42
|
+
# column - The Integer number of characters from the start of the line to
|
43
|
+
# the start of the Token.
|
44
|
+
#
|
45
|
+
# Returns the instantiated Token.
|
46
|
+
def initialize(type, value, line, column)
|
47
|
+
@value = value
|
48
|
+
@type = type
|
49
|
+
@line = line
|
50
|
+
@column = column
|
51
|
+
@next_token = nil
|
52
|
+
@prev_token = nil
|
53
|
+
@next_code_token = nil
|
54
|
+
@prev_code_token = nil
|
55
|
+
end
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
57
|
+
# Public: Produce a human friendly description of the Token when
|
58
|
+
# inspected.
|
59
|
+
#
|
60
|
+
# Returns a String describing the Token.
|
61
|
+
def inspect
|
62
|
+
"<Token #{@type.inspect} (#{@value}) @#{@line}:#{@column}>"
|
63
|
+
end
|
65
64
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
else
|
86
|
-
"$#{@value}"
|
87
|
-
end
|
88
|
-
when :UNENC_VARIABLE
|
89
|
-
"$#{@value}"
|
90
|
-
when :NEWLINE
|
91
|
-
"\n"
|
92
|
-
when :COMMENT
|
93
|
-
"##{@value}"
|
94
|
-
when :REGEX
|
95
|
-
"/#{@value}/"
|
96
|
-
when :MLCOMMENT
|
97
|
-
@raw
|
98
|
-
when :HEREDOC_OPEN
|
99
|
-
"@(#{@value})"
|
100
|
-
when :HEREDOC
|
101
|
-
@raw
|
102
|
-
when :HEREDOC_PRE
|
103
|
-
"#{@value}#{string_suffix}"
|
104
|
-
when :HEREDOC_POST
|
105
|
-
"#{string_prefix}#{@raw}"
|
106
|
-
when :HEREDOC_MID
|
107
|
-
"#{string_prefix}#{@value}#{string_suffix}"
|
65
|
+
# Public: Produce a Puppet DSL representation of a Token.
|
66
|
+
#
|
67
|
+
# Returns a Puppet DSL String.
|
68
|
+
def to_manifest
|
69
|
+
case @type
|
70
|
+
when :STRING
|
71
|
+
"\"#{@value}\""
|
72
|
+
when :SSTRING
|
73
|
+
"'#{@value}'"
|
74
|
+
when :DQPRE
|
75
|
+
"\"#{@value}#{string_suffix}"
|
76
|
+
when :DQPOST
|
77
|
+
"#{string_prefix}#{@value}\""
|
78
|
+
when :DQMID
|
79
|
+
"#{string_prefix}#{@value}#{string_suffix}"
|
80
|
+
when :VARIABLE
|
81
|
+
enclose_token_types = Set[:DQPRE, :DQMID, :HEREDOC_PRE, :HEREDOC_MID].freeze
|
82
|
+
if !@prev_code_token.nil? && enclose_token_types.include?(@prev_code_token.type)
|
83
|
+
@raw.nil? ? @value : @raw
|
108
84
|
else
|
109
|
-
@value
|
85
|
+
"$#{@value}"
|
110
86
|
end
|
87
|
+
when :UNENC_VARIABLE
|
88
|
+
"$#{@value}"
|
89
|
+
when :NEWLINE
|
90
|
+
"\n"
|
91
|
+
when :COMMENT
|
92
|
+
"##{@value}"
|
93
|
+
when :REGEX
|
94
|
+
"/#{@value}/"
|
95
|
+
when :MLCOMMENT
|
96
|
+
@raw
|
97
|
+
when :HEREDOC_OPEN
|
98
|
+
"@(#{@value})"
|
99
|
+
when :HEREDOC
|
100
|
+
@raw
|
101
|
+
when :HEREDOC_PRE
|
102
|
+
"#{@value}#{string_suffix}"
|
103
|
+
when :HEREDOC_POST
|
104
|
+
"#{string_prefix}#{@raw}"
|
105
|
+
when :HEREDOC_MID
|
106
|
+
"#{string_prefix}#{@value}#{string_suffix}"
|
107
|
+
else
|
108
|
+
@value
|
111
109
|
end
|
110
|
+
end
|
112
111
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
end
|
112
|
+
def string_suffix
|
113
|
+
no_enclose_tokens = Set.new([:UNENC_VARIABLE, :DQMID, :DQPOST, :HEREDOC_MID, :HEREDOC_POST])
|
114
|
+
if next_token && no_enclose_tokens.include?(next_token.type)
|
115
|
+
''
|
116
|
+
else
|
117
|
+
'${'
|
120
118
|
end
|
119
|
+
end
|
121
120
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
end
|
121
|
+
def string_prefix
|
122
|
+
no_enclose_tokens = Set.new([:UNENC_VARIABLE, :DQPRE, :DQMID, :HEREDOC_PRE, :HEREDOC_MID])
|
123
|
+
if prev_token && no_enclose_tokens.include?(prev_token.type)
|
124
|
+
''
|
125
|
+
else
|
126
|
+
'}'
|
129
127
|
end
|
128
|
+
end
|
130
129
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
130
|
+
# Public: Search from this token to find the next token of a given type.
|
131
|
+
#
|
132
|
+
# type - A Symbol type of the token to find, or an Array of Symbols.
|
133
|
+
# opts - An optional Hash
|
134
|
+
# :value - A token value to search for in addition to type
|
135
|
+
# :skip_blocks - A Boolean to specify whether { } blocks should be
|
136
|
+
# skipped over (defaults to true).
|
137
|
+
#
|
138
|
+
# Returns a PuppetLint::Lexer::Token object if a matching token could be
|
139
|
+
# found, otherwise nil.
|
140
|
+
def next_token_of(type, opts = {})
|
141
|
+
find_token_of(:next, type, opts)
|
142
|
+
end
|
144
143
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
144
|
+
# Public: Search from this token to find the previous token of a given type.
|
145
|
+
#
|
146
|
+
# type - A Symbol type of the token to find, or an Array of Symbols.
|
147
|
+
# opts - An optional Hash
|
148
|
+
# :value - A token value to search for in addition to type
|
149
|
+
# :skip_blocks - A Boolean to specify whether { } blocks should be
|
150
|
+
# skipped over (defaults to true).
|
151
|
+
#
|
152
|
+
# Returns a PuppetLint::Lexer::Token object if a matching token could be
|
153
|
+
# found, otherwise nil.
|
154
|
+
def prev_token_of(type, opts = {})
|
155
|
+
find_token_of(:prev, type, opts)
|
156
|
+
end
|
158
157
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
158
|
+
# Internal: Search from this token to find the next token of a given type
|
159
|
+
# in a given direction.
|
160
|
+
#
|
161
|
+
# direction - A Symbol direction to search (:next or :prev).
|
162
|
+
# type - A Symbol type of the token to find, or an Array of Symbols.
|
163
|
+
# opts - An optional Hash
|
164
|
+
# :value - A token value to search for in addition to type
|
165
|
+
# :skip_blocks - A Boolean to specify whether { } blocks should be
|
166
|
+
# skipped over (defaults to true).
|
167
|
+
#
|
168
|
+
# Returns a PuppetLint::Lexer::Token object if a matching token could be
|
169
|
+
# found, otherwise nil.
|
170
|
+
def find_token_of(direction, type, opts = {})
|
171
|
+
return nil unless [:next, :prev].include?(direction)
|
172
|
+
|
173
|
+
opts[:skip_blocks] ||= true
|
174
|
+
to_find = Array[*type]
|
175
|
+
|
176
|
+
token_iter = send("#{direction}_token".to_sym)
|
177
|
+
until token_iter.nil?
|
178
|
+
if to_find.include?(token_iter.type)
|
179
|
+
return token_iter if opts[:value].nil? || token_iter.value == opts[:value]
|
180
|
+
end
|
182
181
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
end
|
182
|
+
opening_token = direction == :next ? 'L' : 'R'
|
183
|
+
closing_token = direction == :next ? 'R' : 'L'
|
184
|
+
|
185
|
+
if opts[:skip_blocks]
|
186
|
+
case token_iter.type
|
187
|
+
when "#{opening_token}BRACE".to_sym
|
188
|
+
token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}BRACE".to_sym, opts])
|
189
|
+
when "#{opening_token}BRACK".to_sym
|
190
|
+
token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}BRACK".to_sym, opts])
|
191
|
+
when "#{opening_token}PAREN".to_sym
|
192
|
+
token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}PAREN".to_sym, opts])
|
195
193
|
end
|
196
|
-
|
197
|
-
return nil if token_iter.nil?
|
198
|
-
token_iter = token_iter.send("#{direction}_token".to_sym)
|
199
194
|
end
|
200
|
-
nil
|
201
|
-
end
|
202
195
|
|
203
|
-
|
204
|
-
|
205
|
-
return true if type == :NAME
|
206
|
-
PuppetLint::Lexer::KEYWORDS.include?(type.to_s.downcase)
|
196
|
+
return nil if token_iter.nil?
|
197
|
+
token_iter = token_iter.send("#{direction}_token".to_sym)
|
207
198
|
end
|
199
|
+
nil
|
200
|
+
end
|
201
|
+
|
202
|
+
def interpolated_variable?
|
203
|
+
return false if type == :TYPE && value != 'type'
|
204
|
+
return true if type == :NAME
|
205
|
+
PuppetLint::Lexer::KEYWORDS.include?(type.to_s.downcase)
|
208
206
|
end
|
209
207
|
end
|
210
208
|
end
|