Skip to content

Commit 7bf8b43

Browse files
Fix rubocop warnings
Signed-off-by: Gavin Didrichsen <[email protected]>
1 parent e14a510 commit 7bf8b43

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/puppet-lint/lexer/token.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ def find_token_of(direction, type, opts = {})
172172
return nil unless [:next, :prev].include?(direction)
173173

174174
opts[:skip_blocks] ||= true
175-
to_find = Array[*type]
175+
to_find = [*type]
176176

177-
token_iter = send("#{direction}_token".to_sym)
177+
token_iter = send(:"#{direction}_token")
178178
until token_iter.nil?
179179
return token_iter if to_find.include?(token_iter.type) && (opts[:value].nil? || token_iter.value == opts[:value])
180180

@@ -183,18 +183,18 @@ def find_token_of(direction, type, opts = {})
183183

184184
if opts[:skip_blocks]
185185
case token_iter.type
186-
when "#{opening_token}BRACE".to_sym
187-
token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}BRACE".to_sym, opts])
188-
when "#{opening_token}BRACK".to_sym
189-
token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}BRACK".to_sym, opts])
190-
when "#{opening_token}PAREN".to_sym
191-
token_iter = token_iter.send("#{direction}_token_of".to_sym, ["#{closing_token}PAREN".to_sym, opts])
186+
when :"#{opening_token}BRACE"
187+
token_iter = token_iter.send(:"#{direction}_token_of", [:"#{closing_token}BRACE", opts])
188+
when :"#{opening_token}BRACK"
189+
token_iter = token_iter.send(:"#{direction}_token_of", [:"#{closing_token}BRACK", opts])
190+
when :"#{opening_token}PAREN"
191+
token_iter = token_iter.send(:"#{direction}_token_of", [:"#{closing_token}PAREN", opts])
192192
end
193193
end
194194

195195
return nil if token_iter.nil?
196196

197-
token_iter = token_iter.send("#{direction}_token".to_sym)
197+
token_iter = token_iter.send(:"#{direction}_token")
198198
end
199199
nil
200200
end

lib/puppet-lint/tasks/puppet-lint.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def define(args, &task_block)
6565

6666
['with_filename', 'fail_on_warnings', 'error_level', 'log_format', 'with_context', 'fix', 'show_ignored', 'relative'].each do |config|
6767
value = instance_variable_get(:"@#{config}")
68-
PuppetLint.configuration.send("#{config}=".to_sym, value) unless value.nil?
68+
PuppetLint.configuration.send(:"#{config}=", value) unless value.nil?
6969
end
7070

7171
@ignore_paths = PuppetLint.configuration.ignore_paths if PuppetLint.configuration.ignore_paths && @ignore_paths.empty?

0 commit comments

Comments
 (0)