danger 3.6.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21f670d087989c2099520be07dd3e1204a9c2eef
|
4
|
+
data.tar.gz: 3fbfee83973b73b19496f8c8bd74dd2ecbd8e09d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11595711e242836e3328f7f0b1f4ef3ab54d60b561c2507052ddc74b0209f323f6fe04e5c96a1525026e055745b5f3a3eb86fee550e70bcb0df7cdfafc9a902e
|
7
|
+
data.tar.gz: 0367b7abdc0e048bc0cbcb7fbb7f324520952ed13b0b4de3e4eea87cc6bafae900ff0bbf3cb97baa9ff7be89d8f0f93910cd840de9e362012c0aa4f3673a95f3
|
@@ -28,15 +28,15 @@ module Danger
|
|
28
28
|
#
|
29
29
|
# fail "Please re-submit this MR to develop, we may have already fixed your issue." if gitlab.branch_for_merge != "develop"
|
30
30
|
#
|
31
|
-
# @example Note when MRs don't reference a milestone,
|
31
|
+
# @example Note when MRs don't reference a milestone, make the warning stick around on subsequent runs
|
32
32
|
#
|
33
33
|
# has_milestone = gitlab.mr_json["milestone"] != nil
|
34
|
-
# warn("This MR does not refer to an existing milestone", sticky:
|
34
|
+
# warn("This MR does not refer to an existing milestone", sticky: true) unless has_milestone
|
35
35
|
#
|
36
|
-
# @example Note when a MR cannot be manually merged
|
36
|
+
# @example Note when a MR cannot be manually merged
|
37
37
|
#
|
38
38
|
# can_merge = gitlab.mr_json["mergeable"]
|
39
|
-
# warn("This MR cannot be merged yet."
|
39
|
+
# warn("This MR cannot be merged yet.") unless can_merge
|
40
40
|
#
|
41
41
|
# @example Highlight when a celebrity makes a merge request.
|
42
42
|
#
|
@@ -8,12 +8,13 @@ module Danger
|
|
8
8
|
#
|
9
9
|
# The message within which Danger communicates back is amended on each run in a session.
|
10
10
|
#
|
11
|
-
# Each of `message`, `warn` and `fail` have a `sticky` flag, `
|
12
|
-
# means that the message will be crossed out instead of being removed.
|
13
|
-
# subsequent runs.
|
11
|
+
# Each of `message`, `warn` and `fail` have a `sticky` flag, `false` by default, which
|
12
|
+
# when `true` means that the message will be crossed out instead of being removed.
|
13
|
+
# If it's not called again on subsequent runs.
|
14
14
|
#
|
15
15
|
# By default, using `fail` would fail the corresponding build. Either via an API call, or
|
16
|
-
# via the return value for the danger command.
|
16
|
+
# via the return value for the danger command. If you have linters with errors for this call
|
17
|
+
# you can use `messaging.fail` instead.
|
17
18
|
#
|
18
19
|
# It is possible to have Danger ignore specific warnings or errors by writing `Danger: Ignore "[warning/error text]"`.
|
19
20
|
#
|
@@ -23,9 +24,9 @@ module Danger
|
|
23
24
|
#
|
24
25
|
# fail "This build didn't pass tests"
|
25
26
|
#
|
26
|
-
# @example Failing a build,
|
27
|
+
# @example Failing a build, and note that on subsequent runs
|
27
28
|
#
|
28
|
-
# fail("This build didn't pass tests", sticky:
|
29
|
+
# fail("This build didn't pass tests", sticky: true)
|
29
30
|
#
|
30
31
|
# @example Passing a warning
|
31
32
|
#
|
@@ -87,14 +88,14 @@ module Danger
|
|
87
88
|
# The message to present to the user
|
88
89
|
# @param [Boolean] sticky
|
89
90
|
# Whether the message should be kept after it was fixed,
|
90
|
-
# defaults to `
|
91
|
+
# defaults to `false`.
|
91
92
|
# @param [String] file
|
92
93
|
# Optional. Path to the file that the message is for.
|
93
94
|
# @param [String] line
|
94
95
|
# Optional. The line in the file to present the message in.
|
95
96
|
# @return [void]
|
96
97
|
#
|
97
|
-
def message(message, sticky:
|
98
|
+
def message(message, sticky: false, file: nil, line: nil)
|
98
99
|
@messages << Violation.new(message, sticky, file, line)
|
99
100
|
end
|
100
101
|
|
@@ -105,14 +106,14 @@ module Danger
|
|
105
106
|
# The message to present to the user
|
106
107
|
# @param [Boolean] sticky
|
107
108
|
# Whether the message should be kept after it was fixed,
|
108
|
-
# defaults to `
|
109
|
+
# defaults to `false`.
|
109
110
|
# @param [String] file
|
110
111
|
# Optional. Path to the file that the message is for.
|
111
112
|
# @param [String] line
|
112
113
|
# Optional. The line in the file to present the message in.
|
113
114
|
# @return [void]
|
114
115
|
#
|
115
|
-
def warn(message, sticky:
|
116
|
+
def warn(message, sticky: false, file: nil, line: nil)
|
116
117
|
return if should_ignore_violation(message)
|
117
118
|
@warnings << Violation.new(message, sticky, file, line)
|
118
119
|
end
|
@@ -124,14 +125,14 @@ module Danger
|
|
124
125
|
# The message to present to the user
|
125
126
|
# @param [Boolean] sticky
|
126
127
|
# Whether the message should be kept after it was fixed,
|
127
|
-
# defaults to `
|
128
|
+
# defaults to `false`.
|
128
129
|
# @param [String] file
|
129
130
|
# Optional. Path to the file that the message is for.
|
130
131
|
# @param [String] line
|
131
132
|
# Optional. The line in the file to present the message in.
|
132
133
|
# @return [void]
|
133
134
|
#
|
134
|
-
def fail(message, sticky:
|
135
|
+
def fail(message, sticky: false, file: nil, line: nil)
|
135
136
|
return if should_ignore_violation(message)
|
136
137
|
@errors << Violation.new(message, sticky, file, line)
|
137
138
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
require "gitlab"
|
3
2
|
require "danger/helpers/comments_helper"
|
4
3
|
require "danger/helpers/comment"
|
5
4
|
|
@@ -29,10 +28,19 @@ module Danger
|
|
29
28
|
def client
|
30
29
|
token = @environment["DANGER_GITLAB_API_TOKEN"]
|
31
30
|
raise "No API token given, please provide one using `DANGER_GITLAB_API_TOKEN`" unless token
|
31
|
+
|
32
|
+
# The require happens inline so that it won't cause exceptions when just using the `danger` gem.
|
33
|
+
require "gitlab"
|
34
|
+
|
32
35
|
params = { private_token: token }
|
33
36
|
params[:endpoint] = endpoint
|
34
37
|
|
35
38
|
@client ||= Gitlab.client(params)
|
39
|
+
|
40
|
+
rescue LoadError
|
41
|
+
puts "The GitLab gem was not installed, you will need to change your Gem from `danger` to `danger-gitlab`.".red
|
42
|
+
puts "\n - See https://github.com/danger/danger/blob/master/CHANGELOG.md#400"
|
43
|
+
abort
|
36
44
|
end
|
37
45
|
|
38
46
|
def validates_as_api_source?
|
data/lib/danger/version.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orta Therox
|
8
|
-
-
|
8
|
+
- Juanito Fatas
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
@@ -151,20 +151,6 @@ dependencies:
|
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0.1'
|
154
|
-
- !ruby/object:Gem::Dependency
|
155
|
-
name: gitlab
|
156
|
-
requirement: !ruby/object:Gem::Requirement
|
157
|
-
requirements:
|
158
|
-
- - "~>"
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
version: 3.7.0
|
161
|
-
type: :runtime
|
162
|
-
prerelease: false
|
163
|
-
version_requirements: !ruby/object:Gem::Requirement
|
164
|
-
requirements:
|
165
|
-
- - "~>"
|
166
|
-
- !ruby/object:Gem::Version
|
167
|
-
version: 3.7.0
|
168
154
|
- !ruby/object:Gem::Dependency
|
169
155
|
name: bundler
|
170
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -364,7 +350,7 @@ dependencies:
|
|
364
350
|
description: Stop Saying 'You Forgot To…' in Code Review
|
365
351
|
email:
|
366
352
|
- orta.therox@gmail.com
|
367
|
-
-
|
353
|
+
- katehuang0320@gmail.com
|
368
354
|
executables:
|
369
355
|
- danger
|
370
356
|
extensions: []
|
@@ -454,7 +440,9 @@ homepage: https://github.com/danger/danger
|
|
454
440
|
licenses:
|
455
441
|
- MIT
|
456
442
|
metadata: {}
|
457
|
-
post_install_message:
|
443
|
+
post_install_message: |-
|
444
|
+
Thanks for installing Danger!
|
445
|
+
If you are updating from 3.0, we recommend reading the CHANGELOG: https://github.com/danger/danger/blob/master/CHANGELOG.md
|
458
446
|
rdoc_options: []
|
459
447
|
require_paths:
|
460
448
|
- lib
|