Skip to content

Commit

Permalink
Autocorrect new RuboCop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Dec 28, 2023
1 parent 063b25e commit c0eddc3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/reek/cli/command/todo_list_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Command
#
class TodoListCommand < BaseCommand
HEADER = "# Auto generated by Reeks --todo flag\n"
EXISTING_FILE_MESSAGE = "\nExisting '#{DEFAULT_CONFIGURATION_FILE_NAME}' detected - aborting.\n"
EXISTING_FILE_MESSAGE = "\nExisting '#{DEFAULT_CONFIGURATION_FILE_NAME}' detected - aborting.\n".freeze
NO_SMELLS_FOUND_MESSAGE = "\nNo smells found - nothing to do, exiting.\n"

def execute
Expand Down
2 changes: 1 addition & 1 deletion lib/reek/code_climate/code_climate_fingerprint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def identifying_aspects
end

def parameters
warning.parameters.reject { |key, _| NON_IDENTIFYING_PARAMETERS.include?(key) }.sort.to_s
warning.parameters.except(*NON_IDENTIFYING_PARAMETERS).sort.to_s
end

def warning_uniquely_identifiable?
Expand Down
4 changes: 2 additions & 2 deletions lib/reek/code_comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class CodeComment
(\w+) # smell detector e.g.: UncommunicativeVariableName
(:?\s*) # separator
(\{.*?\})? # details in hash style e.g.: { max_methods: 30 }
/x.freeze
SANITIZE_REGEX = /(#|\n|\s)+/.freeze # Matches '#', newlines and > 1 whitespaces.
/x
SANITIZE_REGEX = /(#|\n|\s)+/ # Matches '#', newlines and > 1 whitespaces.
DISABLE_DETECTOR_CONFIGURATION = '{ enabled: false }'
MINIMUM_CONTENT_LENGTH = 2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Errors
# Gets raised when trying to configure a detector with an option
# which is unknown to it.
class BadDetectorConfigurationKeyInCommentError < BaseError
UNKNOWN_SMELL_DETECTOR_MESSAGE = <<-MESSAGE
UNKNOWN_SMELL_DETECTOR_MESSAGE = <<-MESSAGE.freeze
Error: You are trying to configure the smell detector '%<detector>s'
in one of your source code comments with the unknown option %<option>s.
Expand Down
2 changes: 1 addition & 1 deletion lib/reek/errors/bad_detector_in_comment_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Errors
# This might happen for multiple reasons. The users might have a typo in
# his comment or he might use a detector that does not exist anymore.
class BadDetectorInCommentError < BaseError
UNKNOWN_SMELL_DETECTOR_MESSAGE = <<-MESSAGE
UNKNOWN_SMELL_DETECTOR_MESSAGE = <<-MESSAGE.freeze
Error: You are trying to configure an unknown smell detector '%<detector>s' in one
of your source code comments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Errors
# Gets raised when trying to use a configuration for a detector
# that can't be parsed into a hash.
class GarbageDetectorConfigurationInCommentError < BaseError
BAD_DETECTOR_CONFIGURATION_MESSAGE = <<-MESSAGE
BAD_DETECTOR_CONFIGURATION_MESSAGE = <<-MESSAGE.freeze
Error: You are trying to configure the smell detector '%<detector>s'.
Unfortunately we cannot parse the configuration you have given.
Expand Down
2 changes: 1 addition & 1 deletion lib/reek/errors/legacy_comment_separator_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Reek
module Errors
# Gets raised for old-style comment configuration format.
class LegacyCommentSeparatorError < BaseError
MESSAGE = <<-MESSAGE
MESSAGE = <<-MESSAGE.freeze
Error: You are using the legacy configuration format (including three
colons) to configure Reek in one your source code comments.
Expand Down

0 comments on commit c0eddc3

Please sign in to comment.