Class: CC::Analyzer::IssueRelativePathValidation

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

Instance Method Summary collapse

Methods inherited from Validation

#initialize

Constructor Details

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

Instance Method Details

#messageObject



12
13
14
# File 'lib/cc/analyzer/issue_relative_path_validation.rb', line 12

def message
  "Path must be relative to the project directory"
end

#valid?Boolean

Returns:

  • (Boolean)


6
7
8
9
10
# File 'lib/cc/analyzer/issue_relative_path_validation.rb', line 6

def valid?
  path &&
    !path.start_with?("/") &&
    relative_to?(MountedPath.code.container_path)
end