Skip to content

Commit e07f815

Browse files
committed
Lint/UnderscorePrefixedVariableName
In Ruby, variables should only start with underscore if they are used.
1 parent 446ab56 commit e07f815

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,6 @@ Lint/ToJSON:
638638
- 'lib/puppet/network/http/error.rb'
639639
- 'lib/puppet/pops/serialization/json.rb'
640640

641-
# Configuration parameters: AllowKeywordBlockArguments.
642-
Lint/UnderscorePrefixedVariableName:
643-
Exclude:
644-
- 'lib/puppet/pops/types/p_object_type.rb'
645-
- 'lib/puppet/type/file/checksum_value.rb'
646-
- 'lib/puppet/type/file/content.rb'
647-
648641
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
649642
Lint/UnusedBlockArgument:
650643
Enabled: false

lib/puppet/pops/types/p_object_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def self.feature_type
424424
# @param loader [Loaders::Loader,nil] the loader that loaded the type
425425
#
426426
# @api private
427-
def initialize(_pcore_init_hash, init_hash_expression = nil)
427+
def initialize(_pcore_init_hash, init_hash_expression = nil) # rubocop:disable Lint/UnderscorePrefixedVariableName
428428
if _pcore_init_hash.is_a?(Hash)
429429
_pcore_init_from_hash(_pcore_init_hash)
430430
@loader = init_hash_expression unless init_hash_expression.nil?

lib/puppet/type/file/checksum_value.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def insync?(is)
1919
return true
2020
end
2121

22-
checksum_insync?(resource.parameter(:source), is, true) {|_is| super(_is)}
22+
checksum_insync?(resource.parameter(:source), is, true) {|inner| super(inner)}
2323
end
2424

2525
def property_matches?(current, desired)

lib/puppet/type/file/content.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def insync?(is)
104104
end
105105

106106
contents_prop = resource.parameter(:source) || self
107-
checksum_insync?(contents_prop, is, !resource[:content].nil?) {|_is| super(_is)}
107+
checksum_insync?(contents_prop, is, !resource[:content].nil?) {|inner| super(inner)}
108108
end
109109

110110
def property_matches?(current, desired)

0 commit comments

Comments
 (0)