Class: CC::Analyzer::IssueOtherLocationsFormatValidation

Inherits:
Validation
  • Object
show all
Defined in:
lib/cc/analyzer/issue_other_locations_format_validation.rb

Constant Summary collapse

CHECKS =
[
  IssueLocationFormatValidation,
  IssuePathExistenceValidation,
  IssuePathPresenceValidation,
  IssueRelativePathValidation,
].freeze

Instance Method Summary collapse

Methods inherited from Validation

#initialize

Constructor Details

This class inherits a constructor from CC::Analyzer::Validation

Instance Method Details

#messageObject



20
21
22
# File 'lib/cc/analyzer/issue_other_locations_format_validation.rb', line 20

def message
  "Other locations are not formatted correctly"
end

#valid?Boolean



11
12
13
14
15
16
17
18
# File 'lib/cc/analyzer/issue_other_locations_format_validation.rb', line 11

def valid?
  if object["other_locations"]
    object["other_locations"].is_a?(Array) &&
      object["other_locations"].all?(&method(:other_location_valid?))
  else
    true
  end
end