Module: Gitlab::Ci::Parsers

Defined in:
lib/gitlab/ci/parsers.rb,
lib/gitlab/ci/parsers/test/junit.rb,
lib/gitlab/ci/parsers/parser_error.rb,
lib/gitlab/ci/parsers/security/sast.rb,
lib/gitlab/ci/parsers/instrumentation.rb,
lib/gitlab/ci/parsers/security/common.rb,
lib/gitlab/ci/parsers/terraform/tfplan.rb,
lib/gitlab/ci/parsers/coverage/cobertura.rb,
lib/gitlab/ci/parsers/accessibility/pa11y.rb,
lib/gitlab/ci/parsers/coverage/sax_document.rb,
lib/gitlab/ci/parsers/codequality/code_climate.rb,
lib/gitlab/ci/parsers/security/secret_detection.rb,
lib/gitlab/ci/parsers/security/concerns/deprecated_syntax.rb,
lib/gitlab/ci/parsers/security/validators/schema_validator.rb

Defined Under Namespace

Modules: Accessibility, Codequality, Coverage, Instrumentation, Security, Terraform, Test

Constant Summary collapse

ParserNotFoundError =
Class.new(ParserError)
ParserError =
Class.new(StandardError)

Class Method Summary collapse

Class Method Details

.fabricate!(file_type, *args, **kwargs) ⇒ Object


20
21
22
23
24
# File 'lib/gitlab/ci/parsers.rb', line 20

def self.fabricate!(file_type, *args, **kwargs)
  parsers.fetch(file_type.to_sym).new(*args, **kwargs)
rescue KeyError
  raise ParserNotFoundError, "Cannot find any parser matching file type '#{file_type}'"
end

.instrument!Object


26
27
28
# File 'lib/gitlab/ci/parsers.rb', line 26

def self.instrument!
  parsers.values.each { |parser_class| parser_class.prepend(Parsers::Instrumentation) }
end

.parsersObject


8
9
10
11
12
13
14
15
16
17
18
# File 'lib/gitlab/ci/parsers.rb', line 8

def self.parsers
  {
    junit: ::Gitlab::Ci::Parsers::Test::Junit,
    cobertura: ::Gitlab::Ci::Parsers::Coverage::Cobertura,
    terraform: ::Gitlab::Ci::Parsers::Terraform::Tfplan,
    accessibility: ::Gitlab::Ci::Parsers::Accessibility::Pa11y,
    codequality: ::Gitlab::Ci::Parsers::Codequality::CodeClimate,
    sast: ::Gitlab::Ci::Parsers::Security::Sast,
    secret_detection: ::Gitlab::Ci::Parsers::Security::SecretDetection
  }
end