Sha256: c485e4a2ca41d35b4f52d99dbd9a92dcd8dca71c93fb9c7cc69e050d2f4a0cf1

Contents?: true

Size: 1.41 KB

Versions: 5

Compression:

Stored size: 1.41 KB

Contents

# frozen_string_literal: true

module Reek
  module Errors
    # Gets raised when trying to configure a detector with an option
    # which is unknown to it.
    class BadDetectorConfigurationKeyInCommentError < RuntimeError
      UNKNOWN_SMELL_DETECTOR_MESSAGE = <<-EOS.freeze

        Error: You are trying to configure the smell detector '%s'
        in one of your source code comments with the unknown option %s.
        The source is '%s' and the comment belongs to the expression starting in line %d.
        Here's the original comment:

        %s

        Please see the Reek docs for:
          * how to configure Reek via source code comments: https://github.com/troessner/reek/blob/master/docs/Smell-Suppression.md
          * what basic options are available: https://github.com/troessner/reek/blob/master/docs/Basic-Smell-Options.md
          * what custom options are available by checking the detector specific documentation in /docs
        Update the offensive comment (or remove it if no longer applicable) and re-run Reek.

      EOS

      def initialize(detector_name:, offensive_keys:, source:, line:, original_comment:)
        message = format(UNKNOWN_SMELL_DETECTOR_MESSAGE,
                         detector_name,
                         offensive_keys,
                         source,
                         line,
                         original_comment)
        super message
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
reek-4.5.5 lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb
reek-4.5.4 lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb
reek-4.5.3 lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb
reek-4.5.2 lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb
reek-4.5.1 lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb