Skip to content

Commit

Permalink
Add a forgotten period at the end of some offense message
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed May 2, 2024
1 parent 0fbd9fa commit 49f170b
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 51 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/security/compound_hash.rb
Expand Up @@ -30,8 +30,8 @@ module Security
class CompoundHash < Base
COMBINATOR_IN_HASH_MSG = 'Use `[...].hash` instead of combining hash values manually.'
MONUPLE_HASH_MSG =
'Delegate hash directly without wrapping in an array when only using a single value'
REDUNDANT_HASH_MSG = 'Calling .hash on elements of a hashed array is redundant'
'Delegate hash directly without wrapping in an array when only using a single value.'
REDUNDANT_HASH_MSG = 'Calling .hash on elements of a hashed array is redundant.'

# @!method hash_method_definition?(node)
def_node_matcher :hash_method_definition?, <<~PATTERN
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/conditional_assignment.rb
Expand Up @@ -214,7 +214,7 @@ class ConditionalAssignment < Base
extend AutoCorrector

MSG = 'Use the return of the conditional for variable assignment and comparison.'
ASSIGN_TO_CONDITION_MSG = 'Assign variables inside of conditionals'
ASSIGN_TO_CONDITION_MSG = 'Assign variables inside of conditionals.'
VARIABLE_ASSIGNMENT_TYPES = %i[casgn cvasgn gvasgn ivasgn lvasgn].freeze
ASSIGNMENT_TYPES = VARIABLE_ASSIGNMENT_TYPES + %i[and_asgn or_asgn op_asgn masgn].freeze
LINE_LENGTH = 'Layout/LineLength'
Expand Down
10 changes: 5 additions & 5 deletions spec/rubocop/cop/alignment_corrector_spec.rb
Expand Up @@ -10,7 +10,7 @@
expect_offense(<<~RUBY)
# >> 2
42
^^ Indent this node
^^ Indent this node.
RUBY

expect_correction(<<~RUBY, loop: false)
Expand All @@ -25,7 +25,7 @@
expect_offense(<<~RUBY)
# << 3
42
^^ Indent this node
^^ Indent this node.
RUBY

expect_correction(<<~RUBY, loop: false)
Expand All @@ -44,7 +44,7 @@
expect_offense(<<~RUBY)
# >> #{column_delta}
begin
^^^^^ Indent this node
^^^^^ Indent this node.
#{start_heredoc}
a
b
Expand Down Expand Up @@ -80,7 +80,7 @@
expect_offense(<<~RUBY)
# >> 2
begin
^^^^^ Indent this node
^^^^^ Indent this node.
<<DOC
single line
DOC
Expand All @@ -103,7 +103,7 @@
expect_offense(<<~RUBY)
# >> 2
begin
^^^^^ Indent this node
^^^^^ Indent this node.
dstr =
'a
b
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cop/security/compound_hash_spec.rb
Expand Up @@ -50,15 +50,15 @@ def object.hash
expect_offense(<<~RUBY)
def hash
[1].hash
^^^^^^^^ Delegate hash directly without wrapping in an array when only using a single value
^^^^^^^^ Delegate hash directly without wrapping in an array when only using a single value.
end
RUBY
end

it 'registers an offense if .hash is called on any elements of a hashed array' do
expect_offense(<<~RUBY)
[1, 2.hash, 3].hash
^^^^^^ Calling .hash on elements of a hashed array is redundant
^^^^^^ Calling .hash on elements of a hashed array is redundant.
RUBY
end

Expand Down

0 comments on commit 49f170b

Please sign in to comment.