Module: Gitlab::Dangerfiles

Defined in:
lib/gitlab/dangerfiles.rb,
lib/gitlab/dangerfiles/spin.rb,
lib/gitlab/dangerfiles/config.rb,
lib/gitlab/dangerfiles/changes.rb,
lib/gitlab/dangerfiles/spinner.rb,
lib/gitlab/dangerfiles/version.rb,
lib/gitlab/dangerfiles/approval.rb,
lib/gitlab/dangerfiles/teammate.rb,
lib/gitlab/dangerfiles/weightage.rb,
lib/gitlab/dangerfiles/capability.rb,
lib/gitlab/dangerfiles/base_linter.rb,
lib/gitlab/dangerfiles/task_loader.rb,
lib/gitlab/dangerfiles/commit_linter.rb,
lib/gitlab/dangerfiles/emoji_checker.rb,
lib/gitlab/dangerfiles/title_linting.rb,
lib/gitlab/dangerfiles/type_label_guesser.rb,
lib/gitlab/dangerfiles/weightage/reviewers.rb,
lib/gitlab/dangerfiles/merge_request_linter.rb,
lib/gitlab/dangerfiles/weightage/maintainers.rb

Defined Under Namespace

Modules: TaskLoader, TitleLinting, Weightage Classes: Approval, BaseLinter, Capability, CapabilityStruct, Change, Changes, CommitLinter, Config, EmojiChecker, Engine, MergeRequestLinter, Spin, Spinner, Teammate, TypeLabelGuesser

Constant Summary collapse

RULES_DIR =
File.expand_path("../danger/rules", __dir__)
CI_ONLY_RULES =
%w[
  metadata
  simple_roulette
  type_label
  z_add_labels
  z_retry_link
].freeze
VERSION =
"4.8.0"

Class Method Summary collapse

Class Method Details

.for_project(dangerfile, project_name = nil) ⇒ Gitlab::Dangerfiles::Engine

Utility method to construct a [Gitlab::Dangerfiles::Engine] instance, which is yielded to the given block.

Parameters:

  • dangerfile (Danger::Dangerfile)

    A Danger::Dangerfile object.

  • project_name (defaults to: nil)

    An option string to set the project name. Defaults to ENV.

Returns:



26
27
28
29
30
31
32
33
# File 'lib/gitlab/dangerfiles.rb', line 26

def self.for_project(dangerfile, project_name = nil)
  Engine.new(dangerfile).tap do |engine|
    engine.config.project_root = Pathname.new(File.dirname(dangerfile.defined_in_file))
    engine.config.project_name = project_name if project_name

    yield engine
  end
end

.load_tasksObject



15
16
17
# File 'lib/gitlab/dangerfiles.rb', line 15

def self.load_tasks
  TaskLoader.load_tasks
end