danger-packwerk 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/lib/danger-packwerk/packwerk_wrapper.rb +2 -2
  3. data/lib/danger-packwerk/version.rb +1 -1
  4. data/sorbet/config +1 -0
  5. data/sorbet/rbi/gems/actionview@7.0.4.rbi +11543 -0
  6. data/sorbet/rbi/gems/activesupport@7.0.4.rbi +12959 -0
  7. data/sorbet/rbi/gems/addressable@2.8.1.rbi +1505 -0
  8. data/sorbet/rbi/gems/ast@2.4.2.rbi +522 -0
  9. data/sorbet/rbi/gems/better_html@2.0.1.rbi +286 -0
  10. data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
  11. data/sorbet/rbi/gems/claide-plugins@0.9.2.rbi +791 -0
  12. data/sorbet/rbi/gems/claide@1.1.0.rbi +1132 -0
  13. data/sorbet/rbi/gems/coderay@1.1.3.rbi +2256 -0
  14. data/sorbet/rbi/gems/colored2@3.1.2.rbi +130 -0
  15. data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +8695 -0
  16. data/sorbet/rbi/gems/cork@0.3.0.rbi +248 -0
  17. data/sorbet/rbi/gems/crass@1.0.6.rbi +436 -0
  18. data/sorbet/rbi/gems/danger-plugin-api@1.0.0.rbi +8 -0
  19. data/sorbet/rbi/gems/danger@9.0.0.rbi +4722 -0
  20. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +862 -0
  21. data/sorbet/rbi/gems/erubi@1.11.0.rbi +102 -0
  22. data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +266 -0
  23. data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +209 -0
  24. data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +212 -0
  25. data/sorbet/rbi/gems/faraday-http-cache@2.4.1.rbi +805 -0
  26. data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +221 -0
  27. data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +266 -0
  28. data/sorbet/rbi/gems/faraday-net_http@1.0.1.rbi +216 -0
  29. data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +206 -0
  30. data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +212 -0
  31. data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +225 -0
  32. data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +222 -0
  33. data/sorbet/rbi/gems/faraday@1.10.2.rbi +1862 -0
  34. data/sorbet/rbi/gems/git@1.12.0.rbi +1936 -0
  35. data/sorbet/rbi/gems/i18n@1.12.0.rbi +1643 -0
  36. data/sorbet/rbi/gems/json@2.6.2.rbi +1418 -0
  37. data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +8 -0
  38. data/sorbet/rbi/gems/kramdown@2.4.0.rbi +2168 -0
  39. data/sorbet/rbi/gems/loofah@2.19.0.rbi +646 -0
  40. data/sorbet/rbi/gems/method_source@1.0.0.rbi +199 -0
  41. data/sorbet/rbi/gems/minitest@5.16.3.rbi +997 -0
  42. data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +165 -0
  43. data/sorbet/rbi/gems/nap@1.1.0.rbi +351 -0
  44. data/sorbet/rbi/gems/no_proxy_fix@0.1.2.rbi +8 -0
  45. data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +4916 -0
  46. data/sorbet/rbi/gems/octokit@5.6.1.rbi +8939 -0
  47. data/sorbet/rbi/gems/open4@1.3.4.rbi +8 -0
  48. data/sorbet/rbi/gems/{packwerk@2.1.1.rbi → packwerk@2.2.1.rbi} +602 -51
  49. data/sorbet/rbi/gems/parallel@1.22.1.rbi +163 -0
  50. data/sorbet/rbi/gems/parser@3.1.2.1.rbi +5988 -0
  51. data/sorbet/rbi/gems/pry@0.14.1.rbi +6969 -0
  52. data/sorbet/rbi/gems/public_suffix@5.0.0.rbi +779 -0
  53. data/sorbet/rbi/gems/racc@1.6.0.rbi +92 -0
  54. data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +8 -0
  55. data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +493 -0
  56. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +227 -0
  57. data/sorbet/rbi/gems/rake@13.0.6.rbi +1865 -0
  58. data/sorbet/rbi/gems/rbi@0.0.14.rbi +2337 -0
  59. data/sorbet/rbi/gems/rchardet@1.8.0.rbi +587 -0
  60. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +1851 -0
  61. data/sorbet/rbi/gems/rexml@3.2.5.rbi +3852 -0
  62. data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +7725 -0
  63. data/sorbet/rbi/gems/rspec-expectations@3.11.0.rbi +6201 -0
  64. data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +3625 -0
  65. data/sorbet/rbi/gems/rspec-support@3.11.0.rbi +1176 -0
  66. data/sorbet/rbi/gems/rspec@3.11.0.rbi +40 -0
  67. data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +4193 -0
  68. data/sorbet/rbi/gems/rubocop-sorbet@0.6.8.rbi +677 -0
  69. data/sorbet/rbi/gems/rubocop@1.36.0.rbi +37914 -0
  70. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +732 -0
  71. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  72. data/sorbet/rbi/gems/sawyer@0.9.2.rbi +513 -0
  73. data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +326 -0
  74. data/sorbet/rbi/gems/spoom@1.1.11.rbi +1600 -0
  75. data/sorbet/rbi/gems/tapioca@0.8.0.rbi +1959 -0
  76. data/sorbet/rbi/gems/terminal-table@3.0.2.rbi +438 -0
  77. data/sorbet/rbi/gems/thor@1.2.1.rbi +2921 -0
  78. data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +4879 -0
  79. data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +27 -0
  80. data/sorbet/rbi/gems/unparser@0.6.5.rbi +2789 -0
  81. data/sorbet/rbi/gems/webrick@1.7.0.rbi +1802 -0
  82. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +288 -0
  83. data/sorbet/rbi/gems/yard@0.9.27.rbi +12668 -0
  84. data/sorbet/rbi/todo.rbi +122 -0
  85. metadata +84 -7
  86. data/sorbet/rbi/gems/danger@8.5.0.rbi +0 -122
@@ -0,0 +1,4722 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `danger` gem.
5
+ # Please instead update this file by running `bin/tapioca gem danger`.
6
+
7
+ # Just a less verbose way of doing the Dangerfile from `danger init`.
8
+ module Danger
9
+ class << self
10
+ # @return [String] Latest version of Danger on https://rubygems.org
11
+ def danger_outdated?; end
12
+
13
+ # @return [String] The path to the local gem directory
14
+ def gem_path; end
15
+ end
16
+ end
17
+
18
+ # ### CI Setup
19
+ #
20
+ # Install dependencies and add a danger step to your `appveyor.yml`.
21
+ #
22
+ # ```yaml
23
+ # install:
24
+ # - cmd: >-
25
+ # set PATH=C:\Ruby25-x64\bin;%PATH%
26
+ #
27
+ # bundle install
28
+ # after_test:
29
+ # - cmd: >-
30
+ # bundle exec danger
31
+ # ```
32
+ #
33
+ # ### Token Setup
34
+ #
35
+ # For public repositories, add your plain token to environment variables in `appveyor.yml`.
36
+ # Encrypted environment variables will not be decrypted on PR builds.
37
+ # see here: https://www.appveyor.com/docs/build-configuration/#secure-variables
38
+ #
39
+ # ```yaml
40
+ # environment:
41
+ # DANGER_GITHUB_API_TOKEN: <YOUR_TOKEN_HERE>
42
+ # ```
43
+ #
44
+ # For private repositories, enter your token in `Settings>Environment>Environment variables>Add variable` and turn on `variable encryption`.
45
+ # You will see encrypted variable text in `Settings>Export YAML` so just copy to your `appveyor.yml`.
46
+ #
47
+ # ```yaml
48
+ # environment:
49
+ # DANGER_GITHUB_API_TOKEN:
50
+ # secure: <YOUR_ENCRYPTED_TOKEN_HERE>
51
+ # ```
52
+ class Danger::AppVeyor < ::Danger::CI
53
+ # @return [AppVeyor] a new instance of AppVeyor
54
+ def initialize(env); end
55
+
56
+ def supported_request_sources; end
57
+
58
+ class << self
59
+ # @return [Boolean]
60
+ def validates_as_ci?(env); end
61
+
62
+ # @return [Boolean]
63
+ def validates_as_pr?(env); end
64
+ end
65
+ end
66
+
67
+ # ### CI Setup
68
+ #
69
+ # Add a script step to your appcenter-post-build.sh:
70
+ #
71
+ # ```shell
72
+ # #!/usr/bin/env bash
73
+ # bundle install
74
+ # bundle exec danger
75
+ # ```
76
+ #
77
+ # ### Token Setup
78
+ #
79
+ # Add the `DANGER_GITHUB_API_TOKEN` to your environment variables.
80
+ class Danger::Appcenter < ::Danger::CI
81
+ # @return [Appcenter] a new instance of Appcenter
82
+ def initialize(env); end
83
+
84
+ def supported_request_sources; end
85
+
86
+ class << self
87
+ def owner_for_github(env); end
88
+
89
+ # Hopefully it's a temporary workaround (same as in Codeship integration) because App Center
90
+ # doesn't expose PR's ID. There's a future request https://github.com/Microsoft/appcenter/issues/79
91
+ def pr_from_env(env); end
92
+
93
+ def repo_identifier_for_github(env); end
94
+
95
+ # @return [Boolean]
96
+ def validates_as_ci?(env); end
97
+
98
+ # @return [Boolean]
99
+ def validates_as_pr?(env); end
100
+ end
101
+ end
102
+
103
+ # ### CI Setup
104
+ #
105
+ # Add a script step:
106
+ #
107
+ # ```shell
108
+ # #!/usr/bin/env bash
109
+ # bundle install
110
+ # bundle exec danger
111
+ # ```
112
+ #
113
+ # ### Token Setup
114
+ #
115
+ # Add the `DANGER_GITHUB_API_TOKEN` to your environment variables.
116
+ class Danger::AzurePipelines < ::Danger::CI
117
+ # @return [AzurePipelines] a new instance of AzurePipelines
118
+ def initialize(env); end
119
+
120
+ def supported_request_sources; end
121
+
122
+ class << self
123
+ # @return [Boolean]
124
+ def validates_as_ci?(env); end
125
+
126
+ # @return [Boolean]
127
+ def validates_as_pr?(env); end
128
+ end
129
+ end
130
+
131
+ # ### CI Setup
132
+ #
133
+ # Add a Run Script task that executes `danger` (or `bundle exec danger` if you're using Bundler
134
+ # to manage your gems) as your as part of your Bamboo plan.
135
+ # The minimum supported version is Bamboo 6.9.
136
+ #
137
+ # ### Token Setup
138
+ #
139
+ # IMPORTANT: All required Bamboo environment variables will be available
140
+ # only if the plan is run as part of a pull request. This can be achieved by selecting:
141
+ # Configure plan -> Branches -> Create plan branch: "When pull request is created".
142
+ # Otherwise, `bamboo_repository_pr_key` and `bamboo_planRepository_repositoryUrl`
143
+ # will not be available.
144
+ class Danger::Bamboo < ::Danger::CI
145
+ # @return [Bamboo] a new instance of Bamboo
146
+ def initialize(env); end
147
+
148
+ def supported_request_sources; end
149
+
150
+ class << self
151
+ # @return [Boolean]
152
+ def validates_as_ci?(env); end
153
+
154
+ # @return [Boolean]
155
+ def validates_as_pr?(env); end
156
+ end
157
+ end
158
+
159
+ class Danger::BaseMessage
160
+ # @return [BaseMessage] a new instance of BaseMessage
161
+ def initialize(type:, message:, file: T.unsafe(nil), line: T.unsafe(nil)); end
162
+
163
+ # compares a and b based entirely on whether one or the other is nil
164
+ # arguments are in the same order as `a <=> b`
165
+ # nil is sorted earlier - so cmp_nils(nil, 1) => -1
166
+ #
167
+ # If neither are nil, rather than returning `a <=> b` which would seem
168
+ # like the obvious shortcut, `nil` is returned.
169
+ # This allows us to distinguish between cmp_nils returning 0 for a
170
+ # comparison of filenames, which means "a comparison on the lines is
171
+ # meaningless - you cannot have a line number for a nil file - so they
172
+ # should be sorted the same", and a <=> b returning 0, which means "the
173
+ # files are the same, so compare on the lines"
174
+ #
175
+ # @return 0, 1, -1, or nil
176
+ def cmp_nils(a, b); end
177
+
178
+ def compare_by_file_and_line(other); end
179
+
180
+ # @return [Boolean]
181
+ def eql?(other); end
182
+
183
+ # Returns the value of attribute file.
184
+ def file; end
185
+
186
+ # Sets the attribute file
187
+ #
188
+ # @param value the value to set the attribute file to.
189
+ def file=(_arg0); end
190
+
191
+ # @return [Boolean] returns true if is a file or line, false otherwise
192
+ def inline?; end
193
+
194
+ # Returns the value of attribute line.
195
+ def line; end
196
+
197
+ # Sets the attribute line
198
+ #
199
+ # @param value the value to set the attribute line to.
200
+ def line=(_arg0); end
201
+
202
+ # Returns the value of attribute message.
203
+ def message; end
204
+
205
+ # Sets the attribute message
206
+ #
207
+ # @param value the value to set the attribute message to.
208
+ def message=(_arg0); end
209
+
210
+ # Returns the value of attribute type.
211
+ def type; end
212
+
213
+ # Sets the attribute type
214
+ #
215
+ # @param value the value to set the attribute type to.
216
+ def type=(_arg0); end
217
+ end
218
+
219
+ # ### CI Setup
220
+ #
221
+ # Install dependencies and add a danger step to your `bitbucket-pipelines.yml`.
222
+ #
223
+ # ```yaml
224
+ # script:
225
+ # - bundle exec danger --verbose
226
+ # ```
227
+ #
228
+ # ### Token Setup
229
+ #
230
+ # Add `DANGER_BITBUCKETCLOUD_USERNAME` and `DANGER_BITBUCKETCLOUD_PASSWORD` to your pipeline repository variable
231
+ # or instead using `DANGER_BITBUCKETCLOUD_OAUTH_KEY` and `DANGER_BITBUCKETCLOUD_OAUTH_SECRET`.
232
+ #
233
+ # You can find them in Settings > Pipelines > Repository Variables
234
+ class Danger::BitbucketPipelines < ::Danger::CI
235
+ # @return [BitbucketPipelines] a new instance of BitbucketPipelines
236
+ def initialize(env); end
237
+
238
+ def supported_request_sources; end
239
+
240
+ class << self
241
+ # @return [Boolean]
242
+ def validates_as_ci?(env); end
243
+
244
+ # @return [Boolean]
245
+ def validates_as_pr?(env); end
246
+ end
247
+ end
248
+
249
+ # ### CI Setup
250
+ #
251
+ # Add a script step to your workflow:
252
+ #
253
+ # ```yml
254
+ # - script@1.1.2:
255
+ # inputs:
256
+ # - content: |-
257
+ # bundle install
258
+ # bundle exec danger
259
+ # ```
260
+ #
261
+ # ### Token Setup
262
+ #
263
+ # Add the `DANGER_GITHUB_API_TOKEN` to your workflow's [Secret App Env Vars](https://blog.bitrise.io/anyone-even-prs-can-have-secrets).
264
+ #
265
+ # ### bitbucket server and bitrsie
266
+ #
267
+ # Danger will read the environment variable GIT_REPOSITORY_URL to construct the Bitbucket Server API URL
268
+ # finding the project and repo slug in the GIT_REPOSITORY_URL variable. This GIT_REPOSITORY_URL variable
269
+ # comes from the App Settings tab for your Bitrsie App. If you are manually setting a repo URL in the
270
+ # Git Clone Repo step, you may need to set adjust this propery in the settings tab, maybe even fake it.
271
+ # The patterns used are `(%r{\.com/(.*)})` and `(%r{\.com:(.*)})` and .split(/\.git$|$/) to remove ".git" if the URL contains it.
272
+ class Danger::Bitrise < ::Danger::CI
273
+ # @return [Bitrise] a new instance of Bitrise
274
+ def initialize(env); end
275
+
276
+ def repo_slug_asgiturl(url); end
277
+ def repo_slug_from(url); end
278
+ def supported_request_sources; end
279
+
280
+ class << self
281
+ # @return [Boolean]
282
+ def validates_as_ci?(env); end
283
+
284
+ # @return [Boolean]
285
+ def validates_as_pr?(env); end
286
+ end
287
+ end
288
+
289
+ # ### CI Setup
290
+ #
291
+ # Read how you can setup Danger on the buddybuild blog:
292
+ # https://www.buddybuild.com/blog/using-danger-with-buddybuild/
293
+ #
294
+ # ### Token Setup
295
+ #
296
+ # Login to buddybuild and select your app. Go to your *App Settings* and
297
+ # in the *Build Settings* menu on the left, choose *Environment Variables*.
298
+ # http://docs.buddybuild.com/docs/environment-variables
299
+ #
300
+ # #### GitHub
301
+ # Add the `DANGER_GITHUB_API_TOKEN` to your build user's ENV.
302
+ #
303
+ # #### GitLab
304
+ # Add the `DANGER_GITLAB_API_TOKEN` to your build user's ENV.
305
+ #
306
+ # #### Bitbucket Cloud
307
+ # Add the `DANGER_BITBUCKETSERVER_USERNAME`, `DANGER_BITBUCKETSERVER_PASSWORD`
308
+ # to your build user's ENV.
309
+ #
310
+ # #### Bitbucket server
311
+ # Add the `DANGER_BITBUCKETSERVER_USERNAME`, `DANGER_BITBUCKETSERVER_PASSWORD`
312
+ # and `DANGER_BITBUCKETSERVER_HOST` to your build user's ENV.
313
+ #
314
+ # ### Running Danger
315
+ #
316
+ # Once the environment variables are all available, create a custom build step
317
+ # to run Danger as part of your build process:
318
+ # http://docs.buddybuild.com/docs/custom-prebuild-and-postbuild-steps
319
+ class Danger::Buddybuild < ::Danger::CI
320
+ # @return [Buddybuild] a new instance of Buddybuild
321
+ def initialize(env); end
322
+
323
+ def supported_request_sources; end
324
+
325
+ class << self
326
+ # @return [Boolean]
327
+ def validates_as_ci?(env); end
328
+
329
+ # @return [Boolean]
330
+ def validates_as_pr?(env); end
331
+ end
332
+ end
333
+
334
+ # ### CI Setup
335
+ #
336
+ # With BuildKite you run the server yourself, so you will want to run it as a part of your build process.
337
+ # It is common to have build steps, so we would recommend adding this to your scrip:
338
+ #
339
+ # ```shell
340
+ # echo "--- Running Danger"
341
+ # bundle exec danger
342
+ # ```
343
+ #
344
+ # ### Token Setup
345
+ #
346
+ # #### GitHub
347
+ #
348
+ # As this is self-hosted, you will need to add the `DANGER_GITHUB_API_TOKEN` to your build user's ENV. The alternative
349
+ # is to pass in the token as a prefix to the command `DANGER_GITHUB_API_TOKEN="123" bundle exec danger`.
350
+ #
351
+ # #### GitLab
352
+ #
353
+ # As this is self-hosted, you will need to add the `DANGER_GITLAB_API_TOKEN` to your build user's ENV. The alternative
354
+ # is to pass in the token as a prefix to the command `DANGER_GITLAB_API_TOKEN="123" bundle exec danger`.
355
+ class Danger::Buildkite < ::Danger::CI
356
+ # @return [Buildkite] a new instance of Buildkite
357
+ def initialize(env); end
358
+
359
+ def supported_request_sources; end
360
+
361
+ class << self
362
+ # @return [Boolean]
363
+ def validates_as_ci?(env); end
364
+
365
+ # @return [Boolean]
366
+ def validates_as_pr?(env); end
367
+ end
368
+ end
369
+
370
+ # "abstract" CI class
371
+ class Danger::CI
372
+ # @return [CI] a new instance of CI
373
+ def initialize(_env); end
374
+
375
+ # Returns the value of attribute pull_request_id.
376
+ def pull_request_id; end
377
+
378
+ # Sets the attribute pull_request_id
379
+ #
380
+ # @param value the value to set the attribute pull_request_id to.
381
+ def pull_request_id=(_arg0); end
382
+
383
+ # Returns the value of attribute repo_slug.
384
+ def repo_slug; end
385
+
386
+ # Sets the attribute repo_slug
387
+ #
388
+ # @param value the value to set the attribute repo_slug to.
389
+ def repo_slug=(_arg0); end
390
+
391
+ # Returns the value of attribute repo_url.
392
+ def repo_url; end
393
+
394
+ # Sets the attribute repo_url
395
+ #
396
+ # @param value the value to set the attribute repo_url to.
397
+ def repo_url=(_arg0); end
398
+
399
+ # Returns the value of attribute supported_request_sources.
400
+ def supported_request_sources; end
401
+
402
+ # Sets the attribute supported_request_sources
403
+ #
404
+ # @param value the value to set the attribute supported_request_sources to.
405
+ def supported_request_sources=(_arg0); end
406
+
407
+ # @return [Boolean]
408
+ def supports?(request_source); end
409
+
410
+ class << self
411
+ def available_ci_sources; end
412
+
413
+ # @private
414
+ def inherited(child_class); end
415
+
416
+ # @return [Boolean]
417
+ def validates_as_ci?(_env); end
418
+
419
+ # @return [Boolean]
420
+ def validates_as_pr?(_env); end
421
+ end
422
+ end
423
+
424
+ class Danger::CIDocs < ::Danger::Systems
425
+ def run; end
426
+ end
427
+
428
+ class Danger::CircleAPI
429
+ def client; end
430
+
431
+ # Make the API call, and parse the JSON
432
+ def fetch_build(repo_slug, build_number, token); end
433
+
434
+ # Ask the API if the commit is inside a PR
435
+ def fetch_pull_request_url(repo_slug, build_number, token); end
436
+
437
+ # Determine if there's a PR attached to this commit,
438
+ # and return a bool
439
+ #
440
+ # @return [Boolean]
441
+ def pull_request?(env); end
442
+
443
+ # Determine if there's a PR attached to this commit,
444
+ # and return the url if so
445
+ def pull_request_url(env); end
446
+ end
447
+
448
+ # ### CI Setup
449
+ #
450
+ # For setting up CircleCI, we recommend turning on "Only build pull requests" in "Advanced Settings." Without this enabled,
451
+ # it's trickier for Danger to determine whether you're in a pull request or not, as the environment metadata
452
+ # isn't as reliable.
453
+ #
454
+ # A common scenario is when CircleCI begins building a commit before the commit becomes associated with a PR
455
+ # (e.g. a developer pushes their branch to the remote repo for the first time. CircleCI spins up and begins building.
456
+ # Moments later the developer creates a PR on GitHub. Since the build process started before the PR existed,
457
+ # Danger won't be able to use the Circle-provided environment variables to retrieve PR metadata.)
458
+ #
459
+ # With "Only build pull requests" enabled, you can add `bundle exec danger` to your `config.yml` (Circle 2.0).
460
+ #
461
+ # e.g.
462
+ #
463
+ # ```yaml
464
+ # - run: bundle exec danger --verbose
465
+ # ```
466
+ #
467
+ # And that should be it!
468
+ #
469
+ # ### Token Setup
470
+ #
471
+ # If "Only build pull requests" can't be enabled for your project, Danger _can_ still work by relying on CircleCI's API
472
+ # to retrieve PR metadata, which will require an API token.
473
+ #
474
+ # 1. Go to your project > Settings > API Permissions. Create a token with scope "view-builds" and a label like "DANGER_CIRCLE_CI_API_TOKEN".
475
+ # 2. Settings > Environement Variables. Add the token as a CircleCI environment variable, which exposes it to the Danger process.
476
+ #
477
+ # There is no difference here for OSS vs Closed, both scenarios will need this environment variable.
478
+ #
479
+ # With these pieces in place, Danger should be able to work as expected.
480
+ class Danger::CircleCI < ::Danger::CI
481
+ # @return [CircleCI] a new instance of CircleCI
482
+ def initialize(env); end
483
+
484
+ def supported_request_sources; end
485
+
486
+ class << self
487
+ # Side note: CircleCI is complicated. The env vars for PRs are not guaranteed to exist
488
+ # if the build was triggered from a commit, to look at examples of the different types
489
+ # of CI states, see this repo: https://github.com/orta/show_circle_env
490
+ #
491
+ # @return [Boolean]
492
+ def validates_as_ci?(env); end
493
+
494
+ # @return [Boolean]
495
+ def validates_as_pr?(env); end
496
+ end
497
+ end
498
+
499
+ # ### CI Setup
500
+ # You need to edit your `.cirrus.yml` to include `bundler exec danger`.
501
+ #
502
+ # Adding this to your `.cirrus.yml` allows Danger to fail your build, both on the Cirrus CI website and within your Pull Request.
503
+ # With that set up, you can edit your task to add `bundler exec danger` in any script instruction.
504
+ class Danger::Cirrus < ::Danger::CI
505
+ # @return [Cirrus] a new instance of Cirrus
506
+ def initialize(env); end
507
+
508
+ def supported_request_sources; end
509
+
510
+ class << self
511
+ # @return [Boolean]
512
+ def validates_as_ci?(env); end
513
+
514
+ # @return [Boolean]
515
+ def validates_as_pr?(env); end
516
+ end
517
+ end
518
+
519
+ # ### CI Setup
520
+ #
521
+ # In CodeBuild, make sure to correctly forward CODEBUILD_BUILD_ID, CODEBUILD_SOURCE_VERSION, CODEBUILD_SOURCE_REPO_URL and DANGER_GITHUB_API_TOKEN.
522
+ # In CodeBuild with batch builds, make sure to correctly forward CODEBUILD_BUILD_ID, CODEBUILD_WEBHOOK_TRIGGER, CODEBUILD_SOURCE_REPO_URL, CODEBUILD_BATCH_BUILD_IDENTIFIER and DANGER_GITHUB_API_TOKEN.
523
+ #
524
+ # ### Token Setup
525
+ #
526
+ # Add your `DANGER_GITHUB_API_TOKEN` to your project. Edit -> Environment -> Additional configuration -> Create a parameter
527
+ class Danger::CodeBuild < ::Danger::CI
528
+ # @return [CodeBuild] a new instance of CodeBuild
529
+ def initialize(env); end
530
+
531
+ def supported_request_sources; end
532
+
533
+ class << self
534
+ def extract_pr_url(env); end
535
+ def extract_repo_slug(env); end
536
+ def extract_repo_url(env); end
537
+
538
+ # @return [Boolean]
539
+ def validates_as_ci?(env); end
540
+
541
+ # @return [Boolean]
542
+ def validates_as_pr?(env); end
543
+ end
544
+ end
545
+
546
+ # ### CI Setup
547
+ #
548
+ # To set up Danger on Codefresh, create a freestyle step in your Codefresh yaml configuration:
549
+ #
550
+ # ```yml
551
+ # Danger:
552
+ # title: Run Danger
553
+ # image: alpine/bundle
554
+ # working_directory: ${{main_clone}}
555
+ # commands:
556
+ # - bundle install --deployment
557
+ # - bundle exec danger --verbose
558
+ # ```
559
+ #
560
+ # Don't forget to add the `DANGER_GITHUB_API_TOKEN` variable to your pipeline settings so that Danger can properly post comments to your pull request.
561
+ class Danger::Codefresh < ::Danger::CI
562
+ # @return [Codefresh] a new instance of Codefresh
563
+ def initialize(env); end
564
+
565
+ def supported_request_sources; end
566
+
567
+ class << self
568
+ def slug_from(env); end
569
+
570
+ # @return [Boolean]
571
+ def validates_as_ci?(env); end
572
+
573
+ # @return [Boolean]
574
+ def validates_as_pr?(env); end
575
+ end
576
+ end
577
+
578
+ # ### CI Setup
579
+ #
580
+ # Add a script step to your workflow:
581
+ #
582
+ # ```
583
+ # - name: Running Danger
584
+ # script: |
585
+ # bundle install
586
+ # bundle exec danger
587
+ # ```
588
+ #
589
+ # ### Token Setup
590
+ #
591
+ # Add the following environment variables to your workflow's environment configuration.
592
+ # https://docs.codemagic.io/getting-started/yaml/
593
+ #
594
+ # #### GitHub
595
+ # Add the `DANGER_GITHUB_API_TOKEN` to your build user's ENV.
596
+ #
597
+ # #### GitLab
598
+ # Add the `DANGER_GITLAB_API_TOKEN` to your build user's ENV.
599
+ #
600
+ # #### Bitbucket Cloud
601
+ # Add the `DANGER_BITBUCKETSERVER_USERNAME`, `DANGER_BITBUCKETSERVER_PASSWORD`
602
+ # to your build user's ENV.
603
+ #
604
+ # #### Bitbucket server
605
+ # Add the `DANGER_BITBUCKETSERVER_USERNAME`, `DANGER_BITBUCKETSERVER_PASSWORD`
606
+ # and `DANGER_BITBUCKETSERVER_HOST` to your build user's ENV.
607
+ class Danger::Codemagic < ::Danger::CI
608
+ # @return [Codemagic] a new instance of Codemagic
609
+ def initialize(env); end
610
+
611
+ def supported_request_sources; end
612
+
613
+ class << self
614
+ # @return [Boolean]
615
+ def validates_as_ci?(env); end
616
+
617
+ # @return [Boolean]
618
+ def validates_as_pr?(env); end
619
+ end
620
+ end
621
+
622
+ # ### CI Setup
623
+ #
624
+ # In Codeship, go to your "Project Settings", then add `bundle exec danger` as a test step inside
625
+ # one of your pipelines.
626
+ #
627
+ # ### Token Setup
628
+ #
629
+ # Add your `DANGER_GITHUB_API_TOKEN` to "Environment" section in "Project Settings".
630
+ class Danger::Codeship < ::Danger::CI
631
+ # @return [Codeship] a new instance of Codeship
632
+ def initialize(env); end
633
+
634
+ def supported_request_sources; end
635
+
636
+ class << self
637
+ def owner_for_github(env); end
638
+
639
+ # this is fairly hacky, see https://github.com/danger/danger/pull/892#issuecomment-329030616 for why
640
+ def pr_from_env(env); end
641
+
642
+ # @return [Boolean]
643
+ def validates_as_ci?(env); end
644
+
645
+ # @return [Boolean]
646
+ def validates_as_pr?(env); end
647
+ end
648
+ end
649
+
650
+ class Danger::Comment
651
+ # @return [Comment] a new instance of Comment
652
+ def initialize(id, body, inline = T.unsafe(nil)); end
653
+
654
+ # Returns the value of attribute body.
655
+ def body; end
656
+
657
+ # @return [Boolean]
658
+ def generated_by_danger?(danger_id); end
659
+
660
+ # Returns the value of attribute id.
661
+ def id; end
662
+
663
+ # @return [Boolean]
664
+ def inline?; end
665
+
666
+ class << self
667
+ def from_github(comment); end
668
+ def from_gitlab(comment); end
669
+ end
670
+ end
671
+
672
+ class Danger::Commits
673
+ # @return [Commits] a new instance of Commits
674
+ def initialize(base_head); end
675
+
676
+ def base; end
677
+ def head; end
678
+
679
+ private
680
+
681
+ # Returns the value of attribute base_head.
682
+ def base_head; end
683
+ end
684
+
685
+ # ### CI Setup
686
+ #
687
+ # With Concourse, you run the docker images yourself, so you will want to add `yarn danger ci` within one of your build jobs.
688
+ #
689
+ # ```shell
690
+ # build:
691
+ # image: golang
692
+ # commands:
693
+ # - ...
694
+ # - yarn danger ci
695
+ # ```
696
+ #
697
+ # ### Environment Variable Setup
698
+ #
699
+ # As this is self-hosted, you will need to add the `CONCOURSE` environment variable `export CONCOURSE=true` to your build environment,
700
+ # as well as setting environment variables for `PULL_REQUEST_ID` and `REPO_SLUG`. Assuming you are using the github pull request resource
701
+ # https://github.com/jtarchie/github-pullrequest-resource the id of the PR can be accessed from `git config --get pullrequest.id`.
702
+ #
703
+ # ### Token Setup
704
+ #
705
+ # Once again as this is self-hosted, you will need to add `DANGER_GITHUB_API_TOKEN` environment variable to the build environment.
706
+ # The suggested method of storing the token is within the vault - https://concourse-ci.org/creds.html
707
+ class Danger::Concourse < ::Danger::CI
708
+ # @return [Concourse] a new instance of Concourse
709
+ def initialize(env); end
710
+
711
+ def supported_request_sources; end
712
+
713
+ class << self
714
+ # @return [Boolean]
715
+ def validates_as_ci?(env); end
716
+
717
+ # @return [Boolean]
718
+ def validates_as_pr?(env); end
719
+ end
720
+ end
721
+
722
+ Danger::DESCRIPTION = T.let(T.unsafe(nil), String)
723
+
724
+ # Wraps an exception raised by a DSL file in order to show to the user the
725
+ # contents of the line that raised the exception.
726
+ class Danger::DSLError < ::StandardError
727
+ # @param backtrace [Exception] @see backtrace
728
+ # @param dsl_path [String] @see dsl_path
729
+ # @return [DSLError] a new instance of DSLError
730
+ def initialize(description, dsl_path, backtrace, contents = T.unsafe(nil)); end
731
+
732
+ # @return [Exception] the backtrace of the exception raised by the
733
+ # evaluation of the dsl file.
734
+ def backtrace; end
735
+
736
+ # @return [String] the contents of the DSL that cause the exception to
737
+ # be raised.
738
+ def contents; end
739
+
740
+ # @return [String] the description that should be presented to the user.
741
+ def description; end
742
+
743
+ # @return [String] the path of the dsl file that raised the exception.
744
+ def dsl_path; end
745
+
746
+ # The message of the exception reports the content of podspec for the
747
+ # line that generated the original exception.
748
+ #
749
+ # @example Output
750
+ #
751
+ # Invalid podspec at `RestKit.podspec` - undefined method
752
+ # `exclude_header_search_paths=' for #<Pod::Specification for
753
+ # `RestKit/Network (0.9.3)`>
754
+ #
755
+ # from spec-repos/master/RestKit/0.9.3/RestKit.podspec:36
756
+ # -------------------------------------------
757
+ # # because it would break: #import <CoreData/CoreData.h>
758
+ # > ns.exclude_header_search_paths = 'Code/RestKit.h'
759
+ # end
760
+ # -------------------------------------------
761
+ # @return [String] the message of the exception.
762
+ def message; end
763
+
764
+ def to_markdown; end
765
+
766
+ private
767
+
768
+ def parse; end
769
+ def parse_line_number_from_description; end
770
+ def upgrade_message(latest_version); end
771
+ end
772
+
773
+ class Danger::Dangerfile
774
+ include ::Danger::Dangerfile::DSL
775
+
776
+ # cork_board not being set comes from plugins #585
777
+ #
778
+ # @return [Dangerfile] a new instance of Dangerfile
779
+ def initialize(env_manager, cork_board = T.unsafe(nil)); end
780
+
781
+ def core_dsl_attributes; end
782
+
783
+ # @return [Pathname] the path where the Dangerfile was loaded from. It is nil
784
+ # if the Dangerfile was generated programmatically.
785
+ def defined_in_file; end
786
+
787
+ # @return [Pathname] the path where the Dangerfile was loaded from. It is nil
788
+ # if the Dangerfile was generated programmatically.
789
+ def defined_in_file=(_arg0); end
790
+
791
+ # Returns the value of attribute env.
792
+ def env; end
793
+
794
+ # Sets the attribute env
795
+ #
796
+ # @param value the value to set the attribute env to.
797
+ def env=(_arg0); end
798
+
799
+ def external_dsl_attributes; end
800
+ def fail(*args, **kargs, &blk); end
801
+
802
+ # @return [Boolean]
803
+ def failed?; end
804
+
805
+ # Iterate through available plugin classes and initialize them with
806
+ # a reference to this Dangerfile
807
+ def init_plugins; end
808
+
809
+ def method_missing(method_sym, *arguments, **keyword_arguments, &_block); end
810
+ def method_values_for_plugin_hashes(plugin_hashes); end
811
+
812
+ # Parses the file at a path, optionally takes the content of the file for DI
813
+ def parse(path, contents = T.unsafe(nil)); end
814
+
815
+ # Returns the value of attribute plugins.
816
+ def plugins; end
817
+
818
+ # Sets the attribute plugins
819
+ #
820
+ # @param value the value to set the attribute plugins to.
821
+ def plugins=(_arg0); end
822
+
823
+ def post_results(danger_id, new_comment, remove_previous_comments); end
824
+
825
+ # Iterates through the DSL's attributes, and table's the output
826
+ def print_known_info; end
827
+
828
+ def print_results; end
829
+
830
+ # Iterate through available plugin classes and initialize them with
831
+ # a reference to this Dangerfile
832
+ def refresh_plugins; end
833
+
834
+ def run(base_branch, head_branch, dangerfile_path, danger_id, new_comment, remove_previous_comments, report_results = T.unsafe(nil)); end
835
+ def setup_for_running(base_branch, head_branch); end
836
+
837
+ # @return [String] a string useful to represent the Dangerfile in a message
838
+ # presented to the user.
839
+ def to_s; end
840
+
841
+ # Returns the value of attribute ui.
842
+ def ui; end
843
+
844
+ # Sets the attribute ui
845
+ #
846
+ # @param value the value to set the attribute ui to.
847
+ def ui=(_arg0); end
848
+
849
+ # Returns the value of attribute verbose.
850
+ def verbose; end
851
+
852
+ # Sets the attribute verbose
853
+ #
854
+ # @param value the value to set the attribute verbose to.
855
+ def verbose=(_arg0); end
856
+
857
+ # Both of these methods exist on all objects
858
+ # http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-warn
859
+ # http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-fail
860
+ # However, as we're using using them in the DSL, they won't
861
+ # get method_missing called correctly without overriding them.
862
+ def warn(*args, **kargs, &blk); end
863
+
864
+ private
865
+
866
+ def eval_file(contents, path); end
867
+ def post_exception(ex, danger_id, new_comment); end
868
+ def print_list(title, rows); end
869
+ def wrap_text(text, width = T.unsafe(nil)); end
870
+
871
+ class << self
872
+ # These are the classes that are allowed to also use method_missing
873
+ # in order to provide broader plugin support
874
+ def core_plugin_classes; end
875
+
876
+ # The ones that everything would break without
877
+ def essential_plugin_classes; end
878
+ end
879
+ end
880
+
881
+ # Anything inside this module is considered public API, and in the future
882
+ # documentation will be generated from it via rdoc.
883
+ module Danger::Dangerfile::DSL
884
+ def initialize; end
885
+
886
+ # Provides access to the raw Travis/Circle/Buildkite/GitHub objects, which
887
+ # you can use to pull out extra bits of information. _Warning_
888
+ # the interfaces of these objects is **not** considered a part of the Dangerfile public
889
+ # API, and is viable to change occasionally on the whims of developers.
890
+ #
891
+ # @return [EnvironmentManager]
892
+ def env; end
893
+
894
+ private
895
+
896
+ def load_default_plugins; end
897
+ end
898
+
899
+ # Handles interacting with Bitbucket Cloud inside a Dangerfile. Provides a few functions which wrap `pr_json` and also
900
+ # through a few standard functions to simplify your code.
901
+ #
902
+ # @example Warn when a PR is classed as work in progress
903
+ #
904
+ # warn "PR is classed as Work in Progress" if bitbucket_cloud.pr_title.include? "[WIP]"
905
+ # @example Declare a PR to be simple to avoid specific Danger rules
906
+ #
907
+ # declared_trivial = (bitbucket_cloud.pr_title + bitbucket_cloud.pr_body).include?("#trivial")
908
+ # @example Ensure that labels have been used on the PR
909
+ #
910
+ # failure "Please add labels to this PR" if bitbucket_cloud.pr_labels.empty?
911
+ # @example Ensure there is a summary for a PR
912
+ #
913
+ # failure "Please provide a summary in the Pull Request description" if bitbucket_cloud.pr_body.length < 5
914
+ # @example Only accept PRs to the develop branch
915
+ #
916
+ # failure "Please re-submit this PR to develop, we may have already fixed your issue." if bitbucket_cloud.branch_for_base != "develop"
917
+ # @example Highlight when a celebrity makes a pull request
918
+ #
919
+ # message "Welcome, Danger." if bitbucket_cloud.pr_author == "dangermcshane"
920
+ # @example Ensure that all PRs have an assignee
921
+ #
922
+ # warn "This PR does not have any assignees yet." if bitbucket_cloud.pr_json[:reviewers].length == 0
923
+ # @example Send a message with links to a collection of specific files
924
+ #
925
+ # if git.modified_files.include? "config/*.js"
926
+ # config_files = git.modified_files.select { |path| path.include? "config/" }
927
+ # message "This PR changes #{ bitbucket_cloud.html_link(config_files) }"
928
+ # end
929
+ # @example Highlight with a clickable link if a Package.json is changed
930
+ #
931
+ # warn "#{bitbucket_cloud.html_link("Package.json")} was edited." if git.modified_files.include? "Package.json"
932
+ # @see danger/danger
933
+ class Danger::DangerfileBitbucketCloudPlugin < ::Danger::Plugin
934
+ # @return [DangerfileBitbucketCloudPlugin] a new instance of DangerfileBitbucketCloudPlugin
935
+ def initialize(dangerfile); end
936
+
937
+ # The base commit to which the PR is going to be merged as a parent.
938
+ #
939
+ # @return [String]
940
+ def base_commit; end
941
+
942
+ # The branch to which the PR is going to be merged into.
943
+ #
944
+ # @return [String]
945
+ def branch_for_base; end
946
+
947
+ # The branch to which the PR is going to be merged from.
948
+ #
949
+ # @return [String]
950
+ def branch_for_head; end
951
+
952
+ # The head commit to which the PR is requesting to be merged from.
953
+ #
954
+ # @return [String]
955
+ def head_commit; end
956
+
957
+ # The username of the author of the Pull Request.
958
+ #
959
+ # @return [String]
960
+ def pr_author; end
961
+
962
+ # The body text of the Pull Request.
963
+ #
964
+ # @return [String]
965
+ def pr_body; end
966
+
967
+ # The body text of the Pull Request.
968
+ #
969
+ # @return [String]
970
+ def pr_description; end
971
+
972
+ # The hash that represents the PR's JSON. For an example of what this looks like
973
+ # see the [Danger Fixture'd one](https://raw.githubusercontent.com/danger/danger/master/spec/fixtures/bitbucket_cloud_api/pr_response.json).
974
+ #
975
+ # @return [Hash]
976
+ def pr_json; end
977
+
978
+ # A href that represents the current PR
979
+ #
980
+ # @return [String]
981
+ def pr_link; end
982
+
983
+ # The title of the Pull Request.
984
+ #
985
+ # @return [String]
986
+ def pr_title; end
987
+
988
+ class << self
989
+ # The instance name used in the Dangerfile
990
+ #
991
+ # @return [String]
992
+ def instance_name; end
993
+
994
+ # So that this init can fail.
995
+ def new(dangerfile); end
996
+ end
997
+ end
998
+
999
+ # Handles interacting with Bitbucket Server inside a Dangerfile. Provides a few functions which wrap `pr_json` and also
1000
+ # through a few standard functions to simplify your code.
1001
+ #
1002
+ # @example Warn when a PR is classed as work in progress
1003
+ #
1004
+ # warn "PR is classed as Work in Progress" if bitbucket_server.pr_title.include? "[WIP]"
1005
+ # @example Declare a PR to be simple to avoid specific Danger rules
1006
+ #
1007
+ # declared_trivial = (bitbucket_server.pr_title + bitbucket_server.pr_body).include?("#trivial")
1008
+ # @example Ensure that labels have been used on the PR
1009
+ #
1010
+ # failure "Please add labels to this PR" if bitbucket_server.pr_labels.empty?
1011
+ # @example Ensure there is a summary for a PR
1012
+ #
1013
+ # failure "Please provide a summary in the Pull Request description" if bitbucket_server.pr_body.length < 5
1014
+ # @example Only accept PRs to the develop branch
1015
+ #
1016
+ # failure "Please re-submit this PR to develop, we may have already fixed your issue." if bitbucket_server.branch_for_base != "develop"
1017
+ # @example Highlight when a celebrity makes a pull request
1018
+ #
1019
+ # message "Welcome, Danger." if bitbucket_server.pr_author == "dangermcshane"
1020
+ # @example Ensure that all PRs have an assignee
1021
+ #
1022
+ # warn "This PR does not have any assignees yet." if bitbucket_server.pr_json[:reviewers].length == 0
1023
+ # @example Send a message with links to a collection of specific files
1024
+ #
1025
+ # if git.modified_files.include? "config/*.js"
1026
+ # config_files = git.modified_files.select { |path| path.include? "config/" }
1027
+ # message "This PR changes #{ bitbucket_server.html_link(config_files) }"
1028
+ # end
1029
+ # @example Highlight with a clickable link if a Package.json is changed
1030
+ #
1031
+ # warn "#{bitbucket_server.html_link("Package.json")} was edited." if git.modified_files.include? "Package.json"
1032
+ # @see danger/danger
1033
+ class Danger::DangerfileBitbucketServerPlugin < ::Danger::Plugin
1034
+ # @return [DangerfileBitbucketServerPlugin] a new instance of DangerfileBitbucketServerPlugin
1035
+ def initialize(dangerfile); end
1036
+
1037
+ # The base commit to which the PR is going to be merged as a parent.
1038
+ #
1039
+ # @return [String]
1040
+ def base_commit; end
1041
+
1042
+ # The branch to which the PR is going to be merged into.
1043
+ #
1044
+ # @return [String]
1045
+ def branch_for_base; end
1046
+
1047
+ # The branch to which the PR is going to be merged from.
1048
+ #
1049
+ # @return [String]
1050
+ def branch_for_head; end
1051
+
1052
+ # The head commit to which the PR is requesting to be merged from.
1053
+ #
1054
+ # @return [String]
1055
+ def head_commit; end
1056
+
1057
+ # Returns a list of Markdown links for a file, or files in the head repository.
1058
+ # It returns a string of multiple anchors if passed an array.
1059
+ #
1060
+ # @note Atlassian [disabled inline HTML support](https://jira.atlassian.com/browse/BSERV-7147).
1061
+ # This method method left for backward compatibility.
1062
+ # @param paths [String or Array<String>] A list of strings to convert to github anchors
1063
+ # @param full_path [Bool] Shows the full path as the link's text, defaults to `true`.
1064
+ # @return [String]
1065
+ def html_link(paths, full_path: T.unsafe(nil)); end
1066
+
1067
+ # Returns a list of Markdown links for a file, or files in the head repository.
1068
+ # It returns a string of multiple links if passed an array.
1069
+ #
1070
+ # @param paths [String or Array<String>] A list of strings to convert to Markdown links
1071
+ # @param full_path [Bool] Shows the full path as the link's text, defaults to `true`.
1072
+ # @return [String]
1073
+ def markdown_link(paths, full_path: T.unsafe(nil)); end
1074
+
1075
+ # The username of the author of the Pull Request.
1076
+ #
1077
+ # @return [String]
1078
+ def pr_author; end
1079
+
1080
+ # The body text of the Pull Request.
1081
+ #
1082
+ # @return [String]
1083
+ def pr_body; end
1084
+
1085
+ # The body text of the Pull Request.
1086
+ #
1087
+ # @return [String]
1088
+ def pr_description; end
1089
+
1090
+ # The hash that represents the PR's JSON. For an example of what this looks like
1091
+ # see the [Danger Fixture'd one](https://raw.githubusercontent.com/danger/danger/master/spec/fixtures/bitbucket_server_api/pr_response.json).
1092
+ #
1093
+ # @return [Hash]
1094
+ def pr_json; end
1095
+
1096
+ # A href that represents the current PR
1097
+ #
1098
+ # @return [String]
1099
+ def pr_link; end
1100
+
1101
+ # The title of the Pull Request.
1102
+ #
1103
+ # @return [String]
1104
+ def pr_title; end
1105
+
1106
+ # Updates the PR with build status and build server job link.
1107
+ #
1108
+ # @param status [String] SUCCESSFUL, FAILED and INPROGRESS
1109
+ # @param build_job_link [String] Build server job link
1110
+ # @param description [String] Build status description
1111
+ # @return [String]
1112
+ def update_pr_build_status(status, build_job_link, description); end
1113
+
1114
+ private
1115
+
1116
+ def create_link(paths, full_path); end
1117
+ def create_markdown_link(href, text); end
1118
+
1119
+ class << self
1120
+ # The instance name used in the Dangerfile
1121
+ #
1122
+ # @return [String]
1123
+ def instance_name; end
1124
+
1125
+ # So that this init can fail.
1126
+ def new(dangerfile); end
1127
+ end
1128
+ end
1129
+
1130
+ class Danger::DangerfileCommand < ::Danger::Runner
1131
+ class << self
1132
+ def options; end
1133
+ end
1134
+ end
1135
+
1136
+ # A way to interact with Danger herself. Offering APIs to import plugins,
1137
+ # and Dangerfiles from multiple sources.
1138
+ #
1139
+ # @example Import a plugin available over HTTP
1140
+ #
1141
+ # device_grid = "https://raw.githubusercontent.com/fastlane/fastlane/master/danger-device_grid/lib/device_grid/plugin.rb"
1142
+ # danger.import_plugin(device_grid)
1143
+ # @example Import from a local file reference
1144
+ #
1145
+ # danger.import_plugin("danger/plugins/watch_plugin.rb")
1146
+ # @example Import all files inside a folder
1147
+ #
1148
+ # danger.import_plugin("danger/plugins/*.rb")
1149
+ # @example Run a Dangerfile from inside a sub-folder
1150
+ #
1151
+ # danger.import_dangerfile(path: "path/to/Dangerfile")
1152
+ # @example Run a Dangerfile from inside a gem
1153
+ #
1154
+ # danger.import_dangerfile(gem: "ruby-grape-danger")
1155
+ # @example Run a Dangerfile from inside a repo
1156
+ #
1157
+ # danger.import_dangerfile(gitlab_project_id: 1345)
1158
+ # @example Run a Dangerfile from inside a repo branch and path
1159
+ #
1160
+ # danger.import_dangerfile(github: "ruby-grape/danger", branch: "custom", path: "path/to/Dangerfile")
1161
+ # @example Import a plugin available over HTTP
1162
+ #
1163
+ # custom_url = "https://custom.bitbucket.com/project-name/Dangerfile?raw"
1164
+ # danger.import_dangerfile(url: custom_url)
1165
+ # @see danger/danger
1166
+ class Danger::DangerfileDangerPlugin < ::Danger::Plugin
1167
+ # Import a Dangerfile.
1168
+ #
1169
+ # @option opts
1170
+ # @option opts
1171
+ # @option opts
1172
+ # @option opts
1173
+ # @param opts [Hash]
1174
+ # @return [void]
1175
+ def import_dangerfile(opts); end
1176
+
1177
+ # Download a local or remote plugin and make it usable inside the Dangerfile.
1178
+ #
1179
+ # @param path_or_url [String] a local path or a https URL to the Ruby file to import
1180
+ # a danger plugin from.
1181
+ # @return [void]
1182
+ def import_plugin(path_or_url); end
1183
+
1184
+ # Returns the name of the current SCM Provider being used.
1185
+ #
1186
+ # @return [Symbol] The name of the SCM Provider used for the active repository.
1187
+ def scm_provider; end
1188
+
1189
+ private
1190
+
1191
+ # Download a local or remote plugin or Dangerfile.
1192
+ # This method will not import the file for you, use plugin.import instead
1193
+ #
1194
+ # @param path_or_url [String] a local path or a https URL to the Ruby file to import
1195
+ # a danger plugin from.
1196
+ # @return [String] The path to the downloaded Ruby file
1197
+ def download(path_or_url); end
1198
+
1199
+ # Read and execute a Dangerfile from a gem.
1200
+ #
1201
+ # @param name [String] The name of the gem that contains a Dangerfile.
1202
+ # @return [void]
1203
+ def import_dangerfile_from_gem(name); end
1204
+
1205
+ # Download and execute a remote Dangerfile.
1206
+ #
1207
+ # @param slug [String] A slug that represents the repo where the Dangerfile is.
1208
+ # @param branch [String] A branch from repo where the Dangerfile is.
1209
+ # @param path [String] The path at the repo where Dangerfile is.
1210
+ # @return [void]
1211
+ def import_dangerfile_from_github(slug, branch = T.unsafe(nil), path = T.unsafe(nil)); end
1212
+
1213
+ # Download and execute a remote Dangerfile.
1214
+ #
1215
+ # @param slug_or_project_id [Int] The slug or id of the repo where the Dangerfile is.
1216
+ # @param branch [String] A branch from repo where the Dangerfile is.
1217
+ # @param path [String] The path at the repo where Dangerfile is.
1218
+ # @return [void]
1219
+ def import_dangerfile_from_gitlab(slug_or_project_id, branch = T.unsafe(nil), path = T.unsafe(nil)); end
1220
+
1221
+ # Read and execute a local Dangerfile.
1222
+ #
1223
+ # @param path [String] A path to a Dangerfile.
1224
+ # @return [void]
1225
+ def import_dangerfile_from_path(path); end
1226
+
1227
+ # Download and execute a remote Dangerfile.
1228
+ #
1229
+ # @param url [String] A https url where the Dangerfile is.
1230
+ # @return [void]
1231
+ def import_dangerfile_from_url(url); end
1232
+
1233
+ # Import one or more local plugins.
1234
+ #
1235
+ # @param path [String] The path to the file to import
1236
+ # Can also be a pattern (./**/*plugin.rb)
1237
+ # @return [void]
1238
+ def import_local(path); end
1239
+
1240
+ # Download a remote plugin and use it locally.
1241
+ #
1242
+ # @param url [String] https URL to the Ruby file to use
1243
+ # @return [void]
1244
+ def import_url(url); end
1245
+
1246
+ # Raises an error when the given block does not register a plugin.
1247
+ def validate_file_contains_plugin!(file); end
1248
+
1249
+ class << self
1250
+ # The instance name used in the Dangerfile
1251
+ #
1252
+ # @return [String]
1253
+ def instance_name; end
1254
+ end
1255
+ end
1256
+
1257
+ class Danger::DangerfileGem < ::Danger::DangerfileCommand
1258
+ # @return [DangerfileGem] a new instance of DangerfileGem
1259
+ def initialize(argv); end
1260
+
1261
+ def run; end
1262
+ def validate!; end
1263
+
1264
+ class << self
1265
+ def description; end
1266
+ end
1267
+ end
1268
+
1269
+ class Danger::DangerfileGenerator
1270
+ class << self
1271
+ # returns the string for a Dangerfile based on a folder's contents'
1272
+ def create_dangerfile(_path, _ui); end
1273
+ end
1274
+ end
1275
+
1276
+ # Handles interacting with GitHub inside a Dangerfile. Provides a few functions which wrap `pr_json` and also
1277
+ # through a few standard functions to simplify your code.
1278
+ #
1279
+ # @example Warn when a PR is classed as work in progress
1280
+ #
1281
+ # warn "PR is classed as Work in Progress" if github.pr_title.include? "[WIP]"
1282
+ # @example Declare a PR to be simple to avoid specific Danger rules
1283
+ #
1284
+ # declared_trivial = (github.pr_title + github.pr_body).include?("#trivial")
1285
+ # @example Ensure that labels have been used on the PR
1286
+ #
1287
+ # failure "Please add labels to this PR" if github.pr_labels.empty?
1288
+ # @example Check if a user is in a specific GitHub org, and message them if so
1289
+ #
1290
+ # unless github.api.organization_member?('danger', github.pr_author)
1291
+ # message "@#{github.pr_author} is not a contributor yet, would you like to join the Danger org?"
1292
+ # end
1293
+ # @example Ensure there is a summary for a PR
1294
+ #
1295
+ # failure "Please provide a summary in the Pull Request description" if github.pr_body.length < 5
1296
+ # @example Only accept PRs to the develop branch
1297
+ #
1298
+ # failure "Please re-submit this PR to develop, we may have already fixed your issue." if github.branch_for_base != "develop"
1299
+ # @example Note when PRs don't reference a milestone, which goes away when it does
1300
+ #
1301
+ # has_milestone = github.pr_json["milestone"] != nil
1302
+ # warn("This PR does not refer to an existing milestone", sticky: false) unless has_milestone
1303
+ # @example Note when a PR cannot be manually merged, which goes away when you can
1304
+ #
1305
+ # can_merge = github.pr_json["mergeable"]
1306
+ # warn("This PR cannot be merged yet.", sticky: false) unless can_merge
1307
+ # @example Highlight when a celebrity makes a pull request
1308
+ #
1309
+ # message "Welcome, Danger." if github.pr_author == "dangermcshane"
1310
+ # @example Ensure that all PRs have an assignee
1311
+ #
1312
+ # warn "This PR does not have any assignees yet." unless github.pr_json["assignee"]
1313
+ # @example Send a message with links to a collection of specific files
1314
+ #
1315
+ # if git.modified_files.include? "config/*.js"
1316
+ # config_files = git.modified_files.select { |path| path.include? "config/" }
1317
+ # message "This PR changes #{ github.html_link(config_files) }"
1318
+ # end
1319
+ # @example Highlight with a clickable link if a Package.json is changed
1320
+ #
1321
+ # warn "#{github.html_link("Package.json")} was edited." if git.modified_files.include? "Package.json"
1322
+ # @example Note an issue with a particular line on a file using the #L[num] syntax, e.g. `#L23`
1323
+ #
1324
+ # linter_json = `my_linter lint "file"`
1325
+ # results = JSON.parse linter_json
1326
+ # unless results.empty?
1327
+ # file, line, warning = result.first
1328
+ # warn "#{github.html_link("#{file}#L#{line}")} has linter issue: #{warning}."
1329
+ # end
1330
+ # @see danger/danger
1331
+ class Danger::DangerfileGitHubPlugin < ::Danger::Plugin
1332
+ # @return [DangerfileGitHubPlugin] a new instance of DangerfileGitHubPlugin
1333
+ def initialize(dangerfile); end
1334
+
1335
+ # Provides access to the GitHub API client used inside Danger. Making
1336
+ # it easy to use the GitHub API inside a Dangerfile.
1337
+ #
1338
+ # @return [Octokit::Client]
1339
+ def api; end
1340
+
1341
+ # The base commit to which the PR is going to be merged as a parent.
1342
+ #
1343
+ # @return [String]
1344
+ def base_commit; end
1345
+
1346
+ # The branch to which the PR is going to be merged into.
1347
+ #
1348
+ # @return [String]
1349
+ def branch_for_base; end
1350
+
1351
+ # The branch to which the PR is going to be merged from.
1352
+ #
1353
+ # @return [String]
1354
+ def branch_for_head; end
1355
+
1356
+ # Use to ignore inline messages which lay outside a diff's range, thereby not posting them in the main comment.
1357
+ # You can set hash to change behavior per each kinds. (ex. `{warning: true, error: false}`)
1358
+ #
1359
+ # @param or [Bool] [Hash<Symbol, Bool>] dismiss
1360
+ # Ignore out of range inline messages, defaults to `true`
1361
+ # @return [void]
1362
+ def dismiss_out_of_range_messages(dismiss = T.unsafe(nil)); end
1363
+
1364
+ # The head commit to which the PR is requesting to be merged from.
1365
+ #
1366
+ # @return [String]
1367
+ def head_commit; end
1368
+
1369
+ # Returns a list of HTML anchors for a file, or files in the head repository. An example would be:
1370
+ # `<a href='https://github.com/artsy/eigen/blob/561827e46167077b5e53515b4b7349b8ae04610b/file.txt'>file.txt</a>`. It returns a string of multiple anchors if passed an array.
1371
+ #
1372
+ # @param paths [String or Array<String>] A list of strings to convert to github anchors
1373
+ # @param full_path [Bool] Shows the full path as the link's text, defaults to `true`.
1374
+ # @return [String]
1375
+ def html_link(paths, full_path: T.unsafe(nil)); end
1376
+
1377
+ def mr_author; end
1378
+ def mr_body; end
1379
+ def mr_json; end
1380
+ def mr_labels; end
1381
+ def mr_title; end
1382
+
1383
+ # The username of the author of the Pull Request.
1384
+ #
1385
+ # @return [String]
1386
+ def pr_author; end
1387
+
1388
+ # The body text of the Pull Request.
1389
+ #
1390
+ # @return [String]
1391
+ def pr_body; end
1392
+
1393
+ # The unified diff produced by Github for this PR
1394
+ # see [Unified diff](https://en.wikipedia.org/wiki/Diff_utility#Unified_format)
1395
+ #
1396
+ # @return [String]
1397
+ def pr_diff; end
1398
+
1399
+ # Whether the PR is a Draft.
1400
+ #
1401
+ # @return [Boolean]
1402
+ def pr_draft?; end
1403
+
1404
+ # The hash that represents the PR's JSON. For an example of what this looks like
1405
+ # see the [Danger Fixture'd one](https://raw.githubusercontent.com/danger/danger/master/spec/fixtures/github_api/pr_response.json).
1406
+ #
1407
+ # @return [Hash]
1408
+ def pr_json; end
1409
+
1410
+ # The labels assigned to the Pull Request.
1411
+ #
1412
+ # @return [String]
1413
+ def pr_labels; end
1414
+
1415
+ # The title of the Pull Request.
1416
+ #
1417
+ # @return [String]
1418
+ def pr_title; end
1419
+
1420
+ # In Beta. Provides access to creating a GitHub Review instead of a typical GitHub comment.
1421
+ #
1422
+ # To use you announce the start of your review, and the end via the `start` and `submit` functions,
1423
+ # for example:
1424
+ #
1425
+ # github.review.start
1426
+ # github.review.fail(message)
1427
+ # github.review.warn(message)
1428
+ # github.review.message(message)
1429
+ # github.review.markdown(message)
1430
+ # github.review.submit
1431
+ #
1432
+ # @return [ReviewDSL]
1433
+ def review; end
1434
+
1435
+ private
1436
+
1437
+ def create_link(href, text); end
1438
+
1439
+ class << self
1440
+ # The instance name used in the Dangerfile
1441
+ #
1442
+ # @return [String]
1443
+ def instance_name; end
1444
+
1445
+ # So that this init can fail.
1446
+ def new(dangerfile); end
1447
+ end
1448
+ end
1449
+
1450
+ # Handles interacting with GitLab inside a Dangerfile. Provides a few functions which wrap `mr_json` and also
1451
+ # through a few standard functions to simplify your code.
1452
+ #
1453
+ # @example Warn when an MR is classed as work in progress.
1454
+ #
1455
+ # warn "MR is classed as Work in Progress" if gitlab.mr_title.include? "[WIP]"
1456
+ # @example Declare a MR to be simple to avoid specific Danger rules.
1457
+ #
1458
+ # declared_trivial = (gitlab.mr_title + gitlab.mr_body).include?("#trivial")
1459
+ # @example Ensure that labels have been applied to the MR.
1460
+ #
1461
+ # failure "Please add labels to this MR" if gitlab.mr_labels.empty?
1462
+ # @example Ensure that all MRs have an assignee.
1463
+ #
1464
+ # warn "This MR does not have any assignees yet." unless gitlab.mr_json["assignee"]
1465
+ # @example Ensure there is a summary for a MR.
1466
+ #
1467
+ # failure "Please provide a summary in the Merge Request description" if gitlab.mr_body.length < 5
1468
+ # @example Only accept MRs to the develop branch.
1469
+ #
1470
+ # failure "Please re-submit this MR to develop, we may have already fixed your issue." if gitlab.branch_for_merge != "develop"
1471
+ # @example Note when MRs don't reference a milestone, make the warning stick around on subsequent runs
1472
+ #
1473
+ # has_milestone = gitlab.mr_json["milestone"] != nil
1474
+ # warn("This MR does not refer to an existing milestone", sticky: true) unless has_milestone
1475
+ # @example Note when a MR cannot be manually merged
1476
+ #
1477
+ # can_merge = gitlab.mr_json["mergeable"]
1478
+ # warn("This MR cannot be merged yet.") unless can_merge
1479
+ # @example Highlight when a celebrity makes a merge request.
1480
+ #
1481
+ # message "Welcome, Danger." if gitlab.mr_author == "dangermcshane"
1482
+ # @example Send a message with links to a collection of specific files.
1483
+ #
1484
+ # if git.modified_files.include? "config/*.js"
1485
+ # config_files = git.modified_files.select { |path| path.include? "config/" }
1486
+ # message "This MR changes #{ gitlab.html_link(config_files) }"
1487
+ # end
1488
+ # @example Highlight with a clickable link if a Package.json is changed.
1489
+ #
1490
+ # warn "#{gitlab.html_link("Package.json")} was edited." if git.modified_files.include? "Package.json"
1491
+ # @example Select a random group member as assignee if no assignee is selected
1492
+ #
1493
+ # if gitlab.mr_json["assignee"].nil?
1494
+ # reviewer = gitlab.api.group_members(gitlab.api.merge_request_approvals(project_id, mr_id).to_hash["approver_groups"].first["group"]["id"]).sample
1495
+ # if gitlab.api.group_members(gitlab.api.merge_request_approvals(project_id, mr_id).to_hash["approver_groups"].first["group"]["id"]).length > 1
1496
+ # while reviewer.to_hash["id"] == gitlab.mr_json["author"]["id"] do
1497
+ # reviewer = gitlab.api.group_members(gitlab.api.merge_request_approvals(project_id, mr_id).to_hash["approver_groups"].first["group"]["id"]).sample
1498
+ # end
1499
+ # end
1500
+ # message "Reviewer roulete rolled for: #{reviewer.to_hash['name']} (@#{reviewer.to_hash['username']})"
1501
+ # gitlab.api.update_merge_request(project_id, mr_id, { assignee_id: reviewer.to_hash["id"] })
1502
+ # end
1503
+ # @see danger/danger
1504
+ class Danger::DangerfileGitLabPlugin < ::Danger::Plugin
1505
+ # @return [DangerfileGitLabPlugin] a new instance of DangerfileGitLabPlugin
1506
+ def initialize(dangerfile); end
1507
+
1508
+ # Provides access to the GitLab API client used inside Danger. Making
1509
+ # it easy to use the GitLab API inside a Dangerfile. See the gitlab
1510
+ # gem's [documentation](http://www.rubydoc.info/gems/gitlab/Gitlab/Client)
1511
+ # for accessible methods.
1512
+ #
1513
+ # @return [GitLab::Client]
1514
+ def api; end
1515
+
1516
+ # The base commit to which the MR is going to be merged as a parent
1517
+ #
1518
+ # @return [String]
1519
+ def base_commit; end
1520
+
1521
+ # The branch to which the MR is going to be merged into.
1522
+ #
1523
+ # @return [String]
1524
+ def branch_for_base; end
1525
+
1526
+ # The branch to which the MR is going to be merged from.
1527
+ #
1528
+ # @return [String]
1529
+ def branch_for_head; end
1530
+
1531
+ # The branch to which the MR is going to be merged into
1532
+ #
1533
+ # @deprecated Please use {#branch_for_base} instead
1534
+ # @return [String]
1535
+ def branch_for_merge; end
1536
+
1537
+ # Use to ignore inline messages which lay outside a diff's range, thereby not posting the comment.
1538
+ # You can set hash to change behavior per each kinds. (ex. `{warning: true, error: false}`)
1539
+ #
1540
+ # @param or [Bool] [Hash<Symbol, Bool>] dismiss
1541
+ # Ignore out of range inline messages, defaults to `true`
1542
+ # @return [void]
1543
+ def dismiss_out_of_range_messages(dismiss = T.unsafe(nil)); end
1544
+
1545
+ # The head commit to which the MR is requesting to be merged from
1546
+ #
1547
+ # @return [String]
1548
+ def head_commit; end
1549
+
1550
+ # Returns a list of HTML anchors for a file, or files in the head repository. An example would be:
1551
+ # `<a href='https://gitlab.com/artsy/eigen/blob/561827e46167077b5e53515b4b7349b8ae04610b/file.txt'>file.txt</a>`. It returns a string of multiple anchors if passed an array.
1552
+ #
1553
+ # @param paths [String or Array<String>] A list of strings to convert to gitlab anchors
1554
+ # @param full_path [Bool] Shows the full path as the link's text, defaults to `true`.
1555
+ # @return [String]
1556
+ def html_link(paths, full_path: T.unsafe(nil)); end
1557
+
1558
+ # The username of the author of the Merge Request
1559
+ #
1560
+ # @return [String]
1561
+ def mr_author; end
1562
+
1563
+ # The body text of the Merge Request
1564
+ #
1565
+ # @return [String]
1566
+ def mr_body; end
1567
+
1568
+ # The array of changes
1569
+ #
1570
+ # @return [Array<Gitlab::ObjectifiedHash>]
1571
+ def mr_changes; end
1572
+
1573
+ # The array of issues that this MR closes
1574
+ #
1575
+ # @return [Array<Gitlab::ObjectifiedHash>]
1576
+ def mr_closes_issues; end
1577
+
1578
+ # The unified diff produced by GitLab for this MR
1579
+ # see [Unified diff](https://en.wikipedia.org/wiki/Diff_utility#Unified_format)
1580
+ #
1581
+ # @return [String]
1582
+ def mr_diff; end
1583
+
1584
+ # The hash that represents the MR's JSON. See documentation for the
1585
+ # structure [here](http://docs.gitlab.com/ce/api/merge_requests.html#get-single-mr)
1586
+ #
1587
+ # @return [Hash]
1588
+ def mr_json; end
1589
+
1590
+ # The labels assigned to the Merge Request
1591
+ #
1592
+ # @return [String]
1593
+ def mr_labels; end
1594
+
1595
+ # The title of the Merge Request
1596
+ #
1597
+ # @return [String]
1598
+ def mr_title; end
1599
+
1600
+ def pr_author; end
1601
+ def pr_body; end
1602
+ def pr_diff; end
1603
+ def pr_json; end
1604
+ def pr_labels; end
1605
+ def pr_title; end
1606
+
1607
+ # Returns the web_url of the source project.
1608
+ #
1609
+ # @return [String]
1610
+ def repository_web_url; end
1611
+
1612
+ private
1613
+
1614
+ def create_link(href, text); end
1615
+
1616
+ class << self
1617
+ # The instance name used in the Dangerfile
1618
+ #
1619
+ # @return [String]
1620
+ def instance_name; end
1621
+
1622
+ # So that this init can fail.
1623
+ def new(dangerfile); end
1624
+ end
1625
+ end
1626
+
1627
+ # Handles interacting with git inside a Dangerfile. Providing access to files that have changed, and useful statistics. Also provides
1628
+ # access to the commits in the form of [Git::Log](https://github.com/schacon/ruby-git/blob/master/lib/git/log.rb) objects.
1629
+ #
1630
+ # @example Do something to all new and edited markdown files
1631
+ #
1632
+ # markdowns = (git.added_files + git.modified_files)
1633
+ # do_something markdowns.select{ |file| file.end_with? "md" }
1634
+ # @example Don't allow a file to be deleted
1635
+ #
1636
+ # deleted = git.deleted_files.include? "my/favourite.file"
1637
+ # failure "Don't delete my precious" if deleted
1638
+ # @example Fail really big diffs
1639
+ #
1640
+ # failure "We cannot handle the scale of this PR" if git.lines_of_code > 50_000
1641
+ # @example Warn when there are merge commits in the diff
1642
+ #
1643
+ # if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ }
1644
+ # warn 'Please rebase to get rid of the merge commits in this PR'
1645
+ # end
1646
+ # @example Warn when somebody tries to add nokogiri to the project
1647
+ #
1648
+ # diff = git.diff_for_file("Gemfile.lock")
1649
+ # if diff && diff.patch =~ "nokogiri"
1650
+ # warn 'Please do not add nokogiri to the project. Thank you.'
1651
+ # end
1652
+ # @see danger/danger
1653
+ class Danger::DangerfileGitPlugin < ::Danger::Plugin
1654
+ # @return [DangerfileGitPlugin] a new instance of DangerfileGitPlugin
1655
+ def initialize(dangerfile); end
1656
+
1657
+ # Paths for files that were added during the diff
1658
+ #
1659
+ # @return [FileList<String>] an [Array] subclass
1660
+ def added_files; end
1661
+
1662
+ # The log of commits inside the diff
1663
+ #
1664
+ # @return [Git::Log] from the gem `git`
1665
+ def commits; end
1666
+
1667
+ # Paths for files that were removed during the diff
1668
+ #
1669
+ # @return [FileList<String>] an [Array] subclass
1670
+ def deleted_files; end
1671
+
1672
+ # The overall lines of code removed in the diff
1673
+ #
1674
+ # @return [Fixnum]
1675
+ def deletions; end
1676
+
1677
+ # Whole diff
1678
+ #
1679
+ # @return [Git::Diff] from the gem `git`
1680
+ def diff; end
1681
+
1682
+ # Details for a specific file in this diff
1683
+ #
1684
+ # @return [Git::Diff::DiffFile] from the gem `git`
1685
+ def diff_for_file(file); end
1686
+
1687
+ # Statistics for a specific file in this diff
1688
+ #
1689
+ # @return [Hash] with keys `:insertions`, `:deletions` giving line counts, and `:before`, `:after` giving file contents, or nil if the file has no changes or does not exist
1690
+ def info_for_file(file); end
1691
+
1692
+ # The overall lines of code added in the diff
1693
+ #
1694
+ # @return [Fixnum]
1695
+ def insertions; end
1696
+
1697
+ # The overall lines of code added/removed in the diff
1698
+ #
1699
+ # @return [Fixnum]
1700
+ def lines_of_code; end
1701
+
1702
+ # Paths for files that changed during the diff
1703
+ #
1704
+ # @return [FileList<String>] an [Array] subclass
1705
+ def modified_files; end
1706
+
1707
+ # List of renamed files
1708
+ #
1709
+ # @return [Array<Hash>] with keys `:before` and `:after`
1710
+ def renamed_files; end
1711
+
1712
+ # List of remote tags
1713
+ #
1714
+ # @return [String]
1715
+ def tags; end
1716
+
1717
+ class << self
1718
+ # The instance name used in the Dangerfile
1719
+ #
1720
+ # @return [String]
1721
+ def instance_name; end
1722
+ end
1723
+ end
1724
+
1725
+ class Danger::DangerfileInit < ::Danger::DangerfileCommand
1726
+ def run; end
1727
+ end
1728
+
1729
+ # Handles interacting with local only plugin inside a Dangerfile.
1730
+ # It is support pluggin for dry_run command and does not expose any methods.
1731
+ # But you can still use other plugins like git
1732
+ #
1733
+ # @example Check that added lines contains agreed form of words
1734
+ #
1735
+ # git.diff.each do |chunk|
1736
+ # chunk.patch.lines.grep(/^\+/).each do |added_line|
1737
+ # if added_line.gsub!(/(?<cancel>cancel)(?<rest>[^l[[:space:]][[:punct:]]]+)/i, '>>\k<cancel>-l-\k<rest><<')
1738
+ # fail "Single 'L' for cancellation-alike words in '#{added_line}'"
1739
+ # end
1740
+ # end
1741
+ # end
1742
+ # @see danger/danger
1743
+ class Danger::DangerfileLocalOnlyPlugin < ::Danger::Plugin
1744
+ # @return [DangerfileLocalOnlyPlugin] a new instance of DangerfileLocalOnlyPlugin
1745
+ def initialize(dangerfile); end
1746
+
1747
+ class << self
1748
+ # The instance name used in the Dangerfile
1749
+ #
1750
+ # @return [String]
1751
+ def instance_name; end
1752
+
1753
+ # So that this init can fail.
1754
+ def new(dangerfile); end
1755
+ end
1756
+ end
1757
+
1758
+ # Provides the feedback mechanism for Danger. Danger can keep track of
1759
+ # messages, warnings, failure and post arbitrary markdown into a comment.
1760
+ #
1761
+ # The message within which Danger communicates back is amended on each run in a session.
1762
+ #
1763
+ # Each of `message`, `warn` and `fail` have a `sticky` flag, `false` by default, which
1764
+ # when `true` means that the message will be crossed out instead of being removed.
1765
+ # If it's not called again on subsequent runs.
1766
+ #
1767
+ # Each of `message`, `warn`, `fail` and `markdown` support multiple passed arguments
1768
+ # message 'Hello', 'World', file: "Dangerfile", line: 1
1769
+ # warn ['This', 'is', 'warning'], file: "Dangerfile", line: 1
1770
+ # failure 'Ooops', 'bad bad error', sticky: false
1771
+ # markdown '# And', '# Even', '# Markdown', file: "Dangerfile", line: 1
1772
+ #
1773
+ # By default, using `failure` would fail the corresponding build. Either via an API call, or
1774
+ # via the return value for the danger command. Older code examples use `fail` which is an alias
1775
+ # of `failure`, but the default Rubocop settings would have an issue with it.
1776
+ #
1777
+ # You can optionally add `file` and `line` to provide inline feedback on a PR in GitHub, note that
1778
+ # only feedback inside the PR's diff will show up inline. Others will appear inside the main comment.
1779
+ #
1780
+ # It is possible to have Danger ignore specific warnings or errors by writing `Danger: Ignore "[warning/error text]"`.
1781
+ #
1782
+ # Sidenote: Messaging is the only plugin which adds functions to the root of the Dangerfile.
1783
+ #
1784
+ # @example Failing a build
1785
+ #
1786
+ # failure "This build didn't pass tests"
1787
+ # failure "Ooops!", "Something bad happened"
1788
+ # failure ["This is example", "with array"]
1789
+ # @example Failing a build, and note that on subsequent runs
1790
+ #
1791
+ # failure("This build didn't pass tests", sticky: true)
1792
+ # @example Passing a warning
1793
+ #
1794
+ # warn "This build didn't pass linting"
1795
+ # warn "Hm...", "This is not really good"
1796
+ # warn ["Multiple warnings", "via array"]
1797
+ # @example Displaying a markdown table
1798
+ #
1799
+ # message = "### Proselint found issues\n\n"
1800
+ # message << "Line | Message | Severity |\n"
1801
+ # message << "| --- | ----- | ----- |\n"
1802
+ # message << "20 | No documentation | Error \n"
1803
+ # markdown message
1804
+ #
1805
+ # markdown "### First issue", "### Second issue"
1806
+ # markdown ["### First issue", "### Second issue"]
1807
+ # @example Adding an inline warning to a file
1808
+ #
1809
+ # warn("You shouldn't use puts in your Dangerfile", file: "Dangerfile", line: 10)
1810
+ # @see danger/danger
1811
+ class Danger::DangerfileMessagingPlugin < ::Danger::Plugin
1812
+ # @return [DangerfileMessagingPlugin] a new instance of DangerfileMessagingPlugin
1813
+ def initialize(dangerfile); end
1814
+
1815
+ # Declares a CI blocking error
1816
+ #
1817
+ # @param message [String, Array<String>] The message to present to the user
1818
+ # @param sticky [Boolean] Whether the message should be kept after it was fixed,
1819
+ # defaults to `false`.
1820
+ # @param file [String] Optional. Path to the file that the message is for.
1821
+ # @param line [String] Optional. The line in the file to present the message in.
1822
+ # @return [void]
1823
+ def fail(*failures, **options); end
1824
+
1825
+ # Declares a CI blocking error
1826
+ #
1827
+ # @param message [String, Array<String>] The message to present to the user
1828
+ # @param sticky [Boolean] Whether the message should be kept after it was fixed,
1829
+ # defaults to `false`.
1830
+ # @param file [String] Optional. Path to the file that the message is for.
1831
+ # @param line [String] Optional. The line in the file to present the message in.
1832
+ # @return [void]
1833
+ def failure(*failures, **options); end
1834
+
1835
+ # Print markdown to below the table
1836
+ #
1837
+ # @param message [String, Array<String>] The markdown based message to be printed below the table
1838
+ # @param file [String] Optional. Path to the file that the message is for.
1839
+ # @param line [String] Optional. The line in the file to present the message in.
1840
+ # @return [void]
1841
+ def markdown(*markdowns, **options); end
1842
+
1843
+ # Print out a generate message on the PR
1844
+ #
1845
+ # @param message [String, Array<String>] The message to present to the user
1846
+ # @param sticky [Boolean] Whether the message should be kept after it was fixed,
1847
+ # defaults to `false`.
1848
+ # @param file [String] Optional. Path to the file that the message is for.
1849
+ # @param line [String] Optional. The line in the file to present the message in.
1850
+ # @return [void]
1851
+ def message(*messages, **options); end
1852
+
1853
+ # A list of all messages passed to Danger, including
1854
+ # the markdowns.
1855
+ #
1856
+ # @return [Hash]
1857
+ def status_report; end
1858
+
1859
+ # A list of all violations passed to Danger, we don't
1860
+ # anticipate users of Danger needing to use this.
1861
+ #
1862
+ # @return [Hash]
1863
+ def violation_report; end
1864
+
1865
+ # Specifies a problem, but not critical
1866
+ #
1867
+ # @param message [String, Array<String>] The message to present to the user
1868
+ # @param sticky [Boolean] Whether the message should be kept after it was fixed,
1869
+ # defaults to `false`.
1870
+ # @param file [String] Optional. Path to the file that the message is for.
1871
+ # @param line [String] Optional. The line in the file to present the message in.
1872
+ # @return [void]
1873
+ def warn(*warnings, **options); end
1874
+
1875
+ private
1876
+
1877
+ def should_ignore_violation(message); end
1878
+
1879
+ class << self
1880
+ # The instance name used in the Dangerfile
1881
+ #
1882
+ # @return [String]
1883
+ def instance_name; end
1884
+ end
1885
+ end
1886
+
1887
+ # Handles interacting with VSTS inside a Dangerfile. Provides a few functions which wrap `pr_json` and also
1888
+ # through a few standard functions to simplify your code.
1889
+ #
1890
+ # @example Warn when a PR is classed as work in progress
1891
+ #
1892
+ # warn "PR is classed as Work in Progress" if vsts.pr_title.include? "[WIP]"
1893
+ # @example Declare a PR to be simple to avoid specific Danger rules
1894
+ #
1895
+ # declared_trivial = (vsts.pr_title + vsts.pr_body).include?("#trivial")
1896
+ # @example Ensure there is a summary for a PR
1897
+ #
1898
+ # failure "Please provide a summary in the Pull Request description" if vsts.pr_body.length < 5
1899
+ # @example Only accept PRs to the develop branch
1900
+ #
1901
+ # failure "Please re-submit this PR to develop, we may have already fixed your issue." if vsts.branch_for_base != "develop"
1902
+ # @example Highlight when a celebrity makes a pull request
1903
+ #
1904
+ # message "Welcome, Danger." if vsts.pr_author == "dangermcshane"
1905
+ # @example Ensure that all PRs have an assignee
1906
+ #
1907
+ # warn "This PR does not have any assignees yet." unless vsts.pr_json["reviewers"].length == 0
1908
+ # @example Send a message with links to a collection of specific files
1909
+ #
1910
+ # if git.modified_files.include? "config/*.js"
1911
+ # config_files = git.modified_files.select { |path| path.include? "config/" }
1912
+ # message "This PR changes #{ vsts.markdown_link(config_files) }"
1913
+ # end
1914
+ # @example Highlight with a clickable link if a Package.json is changed
1915
+ #
1916
+ # warn "#{vsts.markdown_link("Package.json")} was edited." if git.modified_files.include? "Package.json"
1917
+ # @example Note an issue with a particular line on a file using the #L[num] syntax, e.g. `#L23`
1918
+ #
1919
+ # linter_json = `my_linter lint "file"`
1920
+ # results = JSON.parse linter_json
1921
+ # unless results.empty?
1922
+ # file, line, warning = result.first
1923
+ # warn "#{vsts.markdown_link("#{file}#L#{line}")} has linter issue: #{warning}."
1924
+ # end
1925
+ # @see danger/danger
1926
+ class Danger::DangerfileVSTSPlugin < ::Danger::Plugin
1927
+ # @return [DangerfileVSTSPlugin] a new instance of DangerfileVSTSPlugin
1928
+ def initialize(dangerfile); end
1929
+
1930
+ # The base commit to which the PR is going to be merged as a parent.
1931
+ #
1932
+ # @return [String]
1933
+ def base_commit; end
1934
+
1935
+ # The branch to which the PR is going to be merged into.
1936
+ #
1937
+ # @return [String]
1938
+ def branch_for_base; end
1939
+
1940
+ # The branch to which the PR is going to be merged from.
1941
+ #
1942
+ # @return [String]
1943
+ def branch_for_head; end
1944
+
1945
+ # The head commit to which the PR is requesting to be merged from.
1946
+ #
1947
+ # @return [String]
1948
+ def head_commit; end
1949
+
1950
+ # Returns a list of Markdown links for a file, or files in the head repository.
1951
+ # It returns a string of multiple links if passed an array.
1952
+ #
1953
+ # @param paths [String or Array<String>] A list of strings to convert to Markdown links
1954
+ # @param full_path [Bool] Shows the full path as the link's text, defaults to `true`.
1955
+ # @return [String]
1956
+ def markdown_link(paths, full_path: T.unsafe(nil)); end
1957
+
1958
+ # The username of the author of the Pull Request.
1959
+ #
1960
+ # @return [String]
1961
+ def pr_author; end
1962
+
1963
+ # The body text of the Pull Request.
1964
+ #
1965
+ # @return [String]
1966
+ def pr_body; end
1967
+
1968
+ # The body text of the Pull Request.
1969
+ #
1970
+ # @return [String]
1971
+ def pr_description; end
1972
+
1973
+ # The hash that represents the PR's JSON. For an example of what this looks like
1974
+ # see the [Danger Fixture'd one](https://raw.githubusercontent.com/danger/danger/master/spec/fixtures/vsts_api/pr_response.json).
1975
+ #
1976
+ # @return [Hash]
1977
+ def pr_json; end
1978
+
1979
+ # A href that represents the current PR
1980
+ #
1981
+ # @return [String]
1982
+ def pr_link; end
1983
+
1984
+ # The title of the Pull Request.
1985
+ #
1986
+ # @return [String]
1987
+ def pr_title; end
1988
+
1989
+ private
1990
+
1991
+ def branch_name(key); end
1992
+ def create_markdown_link(href, text); end
1993
+
1994
+ class << self
1995
+ # The instance name used in the Dangerfile
1996
+ #
1997
+ # @return [String]
1998
+ def instance_name; end
1999
+
2000
+ # So that this init can fail.
2001
+ def new(dangerfile); end
2002
+ end
2003
+ end
2004
+
2005
+ # ### CI Setup
2006
+ # DotCi is a layer on top of jenkins. So, if you're using DotCi, you're hosting your own environment.
2007
+ #
2008
+ # ### Token Setup
2009
+ #
2010
+ # #### GitHub
2011
+ # As you own the machine, it's up to you to add the environment variable for the `DANGER_GITHUB_API_TOKEN`.
2012
+ class Danger::DotCi < ::Danger::CI
2013
+ # @return [DotCi] a new instance of DotCi
2014
+ def initialize(env); end
2015
+
2016
+ def supported_request_sources; end
2017
+
2018
+ class << self
2019
+ def pull_request_id(env); end
2020
+ def repo_url(env); end
2021
+
2022
+ # @return [Boolean]
2023
+ def validates_as_ci?(env); end
2024
+
2025
+ # @return [Boolean]
2026
+ def validates_as_pr?(env); end
2027
+ end
2028
+ end
2029
+
2030
+ # ### CI Setup
2031
+ #
2032
+ # With Drone you run the docker images yourself, so you will want to add `bundle exec danger` at the end of
2033
+ # your `.drone.yml`.
2034
+ #
2035
+ # ```shell
2036
+ # build:
2037
+ # image: golang
2038
+ # commands:
2039
+ # - ...
2040
+ # - bundle exec danger
2041
+ # ```
2042
+ #
2043
+ # ### Token Setup
2044
+ #
2045
+ # As this is self-hosted, you will need to expose the `DANGER_GITHUB_API_TOKEN` as a secret to your
2046
+ # builds:
2047
+ #
2048
+ # Drone secrets: http://readme.drone.io/usage/secret-guide/
2049
+ # NOTE: This is a new syntax in DroneCI 0.6+
2050
+ #
2051
+ # ```yml
2052
+ # build:
2053
+ # image: golang
2054
+ # secrets:
2055
+ # - DANGER_GITHUB_API_TOKEN
2056
+ # commands:
2057
+ # - ...
2058
+ # - bundle exec danger
2059
+ # ```
2060
+ class Danger::Drone < ::Danger::CI
2061
+ # @return [Drone] a new instance of Drone
2062
+ def initialize(env); end
2063
+
2064
+ def supported_request_sources; end
2065
+
2066
+ class << self
2067
+ # @return [Boolean]
2068
+ def validates_as_ci?(env); end
2069
+
2070
+ # Check if this build is valid for CI with drone 0.6 or later
2071
+ #
2072
+ # @return [Boolean]
2073
+ def validates_as_ci_post_06?(env); end
2074
+
2075
+ # Checks if this build is valid for CI with drone 0.5 or earlier
2076
+ #
2077
+ # @return [Boolean]
2078
+ def validates_as_ci_pre_06?(env); end
2079
+
2080
+ # @return [Boolean]
2081
+ def validates_as_pr?(env); end
2082
+ end
2083
+ end
2084
+
2085
+ class Danger::DryRun < ::Danger::Runner
2086
+ # @return [DryRun] a new instance of DryRun
2087
+ def initialize(argv); end
2088
+
2089
+ def run; end
2090
+ def validate!; end
2091
+
2092
+ class << self
2093
+ def options; end
2094
+ end
2095
+ end
2096
+
2097
+ class Danger::EmojiMapper
2098
+ # @return [EmojiMapper] a new instance of EmojiMapper
2099
+ def initialize(template); end
2100
+
2101
+ def from_type(type); end
2102
+ def map(emoji); end
2103
+
2104
+ private
2105
+
2106
+ # Returns the value of attribute template.
2107
+ def template; end
2108
+ end
2109
+
2110
+ Danger::EmojiMapper::DATA = T.let(T.unsafe(nil), Hash)
2111
+ Danger::EmojiMapper::TYPE_TO_EMOJI = T.let(T.unsafe(nil), Hash)
2112
+
2113
+ class Danger::EnvironmentManager
2114
+ # @return [EnvironmentManager] a new instance of EnvironmentManager
2115
+ def initialize(env, ui = T.unsafe(nil), danger_id = T.unsafe(nil)); end
2116
+
2117
+ # Returns the value of attribute ci_source.
2118
+ def ci_source; end
2119
+
2120
+ # Sets the attribute ci_source
2121
+ #
2122
+ # @param value the value to set the attribute ci_source to.
2123
+ def ci_source=(_arg0); end
2124
+
2125
+ def clean_up; end
2126
+
2127
+ # Returns the value of attribute danger_id.
2128
+ def danger_id; end
2129
+
2130
+ # Sets the attribute danger_id
2131
+ #
2132
+ # @param value the value to set the attribute danger_id to.
2133
+ def danger_id=(_arg0); end
2134
+
2135
+ def ensure_danger_branches_are_setup; end
2136
+ def fill_environment_vars; end
2137
+ def meta_info_for_base; end
2138
+ def meta_info_for_head; end
2139
+
2140
+ # @return [Boolean]
2141
+ def pr?; end
2142
+
2143
+ def raise_error_for_no_request_source(env, ui); end
2144
+
2145
+ # Returns the value of attribute request_source.
2146
+ def request_source; end
2147
+
2148
+ # Sets the attribute request_source
2149
+ #
2150
+ # @param value the value to set the attribute request_source to.
2151
+ def request_source=(_arg0); end
2152
+
2153
+ # Returns the value of attribute scm.
2154
+ def scm; end
2155
+
2156
+ # Sets the attribute scm
2157
+ #
2158
+ # @param value the value to set the attribute scm to.
2159
+ def scm=(_arg0); end
2160
+
2161
+ # Returns the value of attribute ui.
2162
+ def ui; end
2163
+
2164
+ # Sets the attribute ui
2165
+ #
2166
+ # @param value the value to set the attribute ui to.
2167
+ def ui=(_arg0); end
2168
+
2169
+ private
2170
+
2171
+ def extract_title_and_subtitle_from_source(repo_url); end
2172
+ def get_repo_source(repo_url); end
2173
+ def travis_note; end
2174
+ def ui_display_no_request_source_error_message(ui, env, title, subtitle); end
2175
+
2176
+ class << self
2177
+ # @return [String] danger's default base branch
2178
+ def danger_base_branch; end
2179
+
2180
+ # @return [String] danger's default head branch
2181
+ def danger_head_branch; end
2182
+
2183
+ # Finds a Danger::CI class based on the ENV
2184
+ def local_ci_source(env); end
2185
+
2186
+ # Uses the current Danger::CI subclass, and sees if it is a PR
2187
+ #
2188
+ # @return [Boolean]
2189
+ def pr?(env); end
2190
+ end
2191
+ end
2192
+
2193
+ class Danger::Executor
2194
+ # @return [Executor] a new instance of Executor
2195
+ def initialize(system_env); end
2196
+
2197
+ def run(env: T.unsafe(nil), dm: T.unsafe(nil), cork: T.unsafe(nil), base: T.unsafe(nil), head: T.unsafe(nil), dangerfile_path: T.unsafe(nil), danger_id: T.unsafe(nil), new_comment: T.unsafe(nil), fail_on_errors: T.unsafe(nil), fail_if_no_pr: T.unsafe(nil), remove_previous_comments: T.unsafe(nil)); end
2198
+ def validate!(cork, fail_if_no_pr: T.unsafe(nil)); end
2199
+
2200
+ private
2201
+
2202
+ def base_branch(user_specified_base_branch); end
2203
+ def commit_request(ci_name); end
2204
+ def head_branch(user_specified_head_branch); end
2205
+
2206
+ # Returns the value of attribute system_env.
2207
+ def system_env; end
2208
+
2209
+ # Could we find a CI source at all?
2210
+ def validate_ci!; end
2211
+
2212
+ # Could we determine that the CI source is inside a PR?
2213
+ def validate_pr!(cork, fail_if_no_pr); end
2214
+ end
2215
+
2216
+ class Danger::FileList
2217
+ include ::Comparable
2218
+ include ::Danger::Helpers::ArraySubclass
2219
+
2220
+ # Information about pattern: http://ruby-doc.org/core-2.2.0/File.html#method-c-fnmatch
2221
+ # e.g. "**/something.*" for any file called something with any extension
2222
+ #
2223
+ # @return [Boolean]
2224
+ def include?(pattern); end
2225
+ end
2226
+
2227
+ class Danger::FindRepoInfoFromLogs
2228
+ # @return [FindRepoInfoFromLogs] a new instance of FindRepoInfoFromLogs
2229
+ def initialize(github_host, remote_logs); end
2230
+
2231
+ def call; end
2232
+
2233
+ private
2234
+
2235
+ # Returns the value of attribute github_host.
2236
+ def github_host; end
2237
+
2238
+ def regexp; end
2239
+ def remote; end
2240
+
2241
+ # Returns the value of attribute remote_logs.
2242
+ def remote_logs; end
2243
+ end
2244
+
2245
+ class Danger::FindRepoInfoFromURL
2246
+ # @return [FindRepoInfoFromURL] a new instance of FindRepoInfoFromURL
2247
+ def initialize(url); end
2248
+
2249
+ def call; end
2250
+
2251
+ private
2252
+
2253
+ # Returns the value of attribute url.
2254
+ def url; end
2255
+ end
2256
+
2257
+ Danger::FindRepoInfoFromURL::REGEXP = T.let(T.unsafe(nil), Regexp)
2258
+
2259
+ # Regex used to extract info from Bitbucket server URLs, as they use a quite different format
2260
+ Danger::FindRepoInfoFromURL::REGEXPBB = T.let(T.unsafe(nil), Regexp)
2261
+
2262
+ Danger::GEM_NAME = T.let(T.unsafe(nil), String)
2263
+
2264
+ class Danger::GemsResolver
2265
+ # @return [GemsResolver] a new instance of GemsResolver
2266
+ def initialize(gem_names); end
2267
+
2268
+ # Returns an Array of paths (plugin lib file paths) and gems (of metadata)
2269
+ def call; end
2270
+
2271
+ private
2272
+
2273
+ def all_gems_metadata; end
2274
+ def create_gemfile_from_gem_names; end
2275
+
2276
+ # Returns the value of attribute dir.
2277
+ def dir; end
2278
+
2279
+ def gem_metadata(gem); end
2280
+
2281
+ # Returns the value of attribute gem_names.
2282
+ def gem_names; end
2283
+
2284
+ def gems; end
2285
+
2286
+ # The paths are relative to dir.
2287
+ def paths; end
2288
+
2289
+ def real_gems; end
2290
+ end
2291
+
2292
+ # ### CI Setup
2293
+ #
2294
+ # You can use `danger/danger` Action in your `.github/workflows/xxx.yml`.
2295
+ # And so, you can use GITHUB_TOKEN secret as `DANGER_GITHUB_API_TOKEN` environment variable.
2296
+ #
2297
+ # ```yml
2298
+ # ...
2299
+ # steps:
2300
+ # - uses: actions/checkout@v1
2301
+ # - uses: danger/danger@master
2302
+ # env:
2303
+ # DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2304
+ # ```
2305
+ class Danger::GitHubActions < ::Danger::CI
2306
+ # @return [GitHubActions] a new instance of GitHubActions
2307
+ def initialize(env); end
2308
+
2309
+ def supported_request_sources; end
2310
+
2311
+ class << self
2312
+ # @return [Boolean]
2313
+ def validates_as_ci?(env); end
2314
+
2315
+ # @return [Boolean]
2316
+ def validates_as_pr?(env); end
2317
+ end
2318
+ end
2319
+
2320
+ # ### CI Setup
2321
+ #
2322
+ # Install dependencies and add a danger step to your .gitlab-ci.yml:
2323
+ #
2324
+ # ```yml
2325
+ # before_script:
2326
+ # - bundle install
2327
+ # danger:
2328
+ # script:
2329
+ # - bundle exec danger
2330
+ # ```
2331
+ #
2332
+ # ### Token Setup
2333
+ #
2334
+ # Add the `DANGER_GITLAB_API_TOKEN` to your pipeline env variables if you
2335
+ # are hosting your code on GitLab. If you are using GitLab as a mirror
2336
+ # for the purpose of CI/CD, while hosting your repo on GitHub, set the
2337
+ # `DANGER_GITHUB_API_TOKEN` as well as the project repo URL to
2338
+ # `DANGER_PROJECT_REPO_URL`.
2339
+ class Danger::GitLabCI < ::Danger::CI
2340
+ # @return [GitLabCI] a new instance of GitLabCI
2341
+ def initialize(env); end
2342
+
2343
+ def supported_request_sources; end
2344
+
2345
+ class << self
2346
+ def determine_pull_or_merge_request_id(env); end
2347
+ def slug_from(env); end
2348
+
2349
+ # @return [Boolean]
2350
+ def validates_as_ci?(env); end
2351
+
2352
+ # @return [Boolean]
2353
+ def validates_as_pr?(env); end
2354
+ end
2355
+ end
2356
+
2357
+ class Danger::GitRepo
2358
+ # Returns the value of attribute diff.
2359
+ def diff; end
2360
+
2361
+ # Sets the attribute diff
2362
+ #
2363
+ # @param value the value to set the attribute diff to.
2364
+ def diff=(_arg0); end
2365
+
2366
+ def diff_for_folder(folder, from: T.unsafe(nil), to: T.unsafe(nil), lookup_top_level: T.unsafe(nil)); end
2367
+ def ensure_commitish_exists!(commitish); end
2368
+ def ensure_commitish_exists_on_branch!(branch, commitish); end
2369
+ def exec(string); end
2370
+
2371
+ # Returns the value of attribute folder.
2372
+ def folder; end
2373
+
2374
+ # Sets the attribute folder
2375
+ #
2376
+ # @param value the value to set the attribute folder to.
2377
+ def folder=(_arg0); end
2378
+
2379
+ def head_commit; end
2380
+
2381
+ # Returns the value of attribute log.
2382
+ def log; end
2383
+
2384
+ # Sets the attribute log
2385
+ #
2386
+ # @param value the value to set the attribute log to.
2387
+ def log=(_arg0); end
2388
+
2389
+ def origins; end
2390
+ def renamed_files; end
2391
+ def tags; end
2392
+
2393
+ private
2394
+
2395
+ # @return [Boolean]
2396
+ def commit_exists?(sha1); end
2397
+
2398
+ # @return [Boolean]
2399
+ def commit_is_ref?(commit); end
2400
+
2401
+ # @return [Boolean]
2402
+ def commit_not_exists?(sha1); end
2403
+
2404
+ def commits_in_branch_count(from, to); end
2405
+ def default_env; end
2406
+ def find_merge_base(repo, from, to); end
2407
+ def find_merge_base_with_incremental_fetch(repo, from, to); end
2408
+ def git_fetch_branch_to_depth(branch, depth); end
2409
+ def git_in_depth_fetch; end
2410
+ def possible_merge_base(repo, from, to); end
2411
+ def raise_if_we_cannot_find_the_commit(commitish); end
2412
+ end
2413
+
2414
+ class Danger::HTTPCache
2415
+ # @return [HTTPCache] a new instance of HTTPCache
2416
+ def initialize(cache_file = T.unsafe(nil), options = T.unsafe(nil)); end
2417
+
2418
+ def delete(key); end
2419
+ def entry_has_expired(entry, ttl); end
2420
+
2421
+ # Returns the value of attribute expires_in.
2422
+ def expires_in; end
2423
+
2424
+ def read(key); end
2425
+ def write(key, value); end
2426
+ end
2427
+
2428
+ module Danger::Helpers; end
2429
+
2430
+ module Danger::Helpers::ArraySubclass
2431
+ include ::Comparable
2432
+
2433
+ def initialize(array); end
2434
+
2435
+ def <=>(other); end
2436
+
2437
+ # @return [Boolean]
2438
+ def kind_of?(compare_class); end
2439
+
2440
+ def method_missing(name, *args, &block); end
2441
+ def to_a; end
2442
+ def to_ary; end
2443
+
2444
+ private
2445
+
2446
+ # Returns the value of attribute __array__.
2447
+ def __array__; end
2448
+
2449
+ # Sets the attribute __array__
2450
+ #
2451
+ # @param value the value to set the attribute __array__ to.
2452
+ def __array__=(_arg0); end
2453
+
2454
+ def dummy; end
2455
+ def respond_to_method(name, *args, &block); end
2456
+
2457
+ # @return [Boolean]
2458
+ def respond_to_missing?(name, include_all); end
2459
+ end
2460
+
2461
+ module Danger::Helpers::CommentsHelper
2462
+ include ::Danger::Helpers::CommentsParsingHelper
2463
+
2464
+ def apply_template(tables: T.unsafe(nil), markdowns: T.unsafe(nil), danger_id: T.unsafe(nil), template: T.unsafe(nil), request_source: T.unsafe(nil)); end
2465
+ def generate_comment(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), previous_violations: T.unsafe(nil), danger_id: T.unsafe(nil), template: T.unsafe(nil)); end
2466
+ def generate_description(warnings: T.unsafe(nil), errors: T.unsafe(nil), template: T.unsafe(nil)); end
2467
+ def generate_inline_comment_body(emoji, message, danger_id: T.unsafe(nil), resolved: T.unsafe(nil), template: T.unsafe(nil)); end
2468
+ def generate_inline_markdown_body(markdown, danger_id: T.unsafe(nil), template: T.unsafe(nil)); end
2469
+
2470
+ # resolved is essentially reserved for future use - eventually we might
2471
+ # have some nice generic resolved-thing going :)
2472
+ def generate_message_group_comment(message_group:, danger_id: T.unsafe(nil), resolved: T.unsafe(nil), template: T.unsafe(nil)); end
2473
+
2474
+ # !@group Extension points
2475
+ # Produces a markdown link to the file the message points to
2476
+ #
2477
+ # request_source implementations are invited to override this method with their
2478
+ # vendor specific link.
2479
+ #
2480
+ # @param message [Violation or Markdown]
2481
+ # @param Should [Bool] hide any generated link created
2482
+ # @return [String] The Markdown compatible link
2483
+ def markdown_link_to_message(message, hide_link); end
2484
+
2485
+ def markdown_parser(text); end
2486
+
2487
+ # !@group Extension points
2488
+ # Determine whether two messages are equivalent
2489
+ #
2490
+ # request_source implementations are invited to override this method.
2491
+ # This is mostly here to enable sources to detect when inlines change only in their
2492
+ # commit hash and not in content per-se. since the link is implementation dependant
2493
+ # so should be the comparison.
2494
+ #
2495
+ # @param m1 [Violation or Markdown]
2496
+ # @param m2 [Violation or Markdown]
2497
+ # @return [Boolean] whether they represent the same message
2498
+ def messages_are_equivalent(m1, m2); end
2499
+
2500
+ def process_markdown(violation, hide_link = T.unsafe(nil)); end
2501
+ def random_compliment; end
2502
+ def table(name, emoji, violations, all_previous_violations, template: T.unsafe(nil)); end
2503
+
2504
+ private
2505
+
2506
+ def pluralize(string, count); end
2507
+ def truncate(string); end
2508
+ end
2509
+
2510
+ module Danger::Helpers::CommentsParsingHelper
2511
+ def parse_comment(comment); end
2512
+
2513
+ # !@group Extension points
2514
+ # Produces a message-like from a row in a comment table
2515
+ #
2516
+ # @param row [String] The content of the row in the table
2517
+ # @return [Violation or Markdown] the extracted message
2518
+ def parse_message_from_row(row); end
2519
+
2520
+ def parse_tables_from_comment(comment); end
2521
+ def table_kind_from_title(title); end
2522
+ def violations_from_table(table); end
2523
+
2524
+ private
2525
+
2526
+ # @return [Boolean]
2527
+ def danger_table?(table); end
2528
+ end
2529
+
2530
+ Danger::Helpers::CommentsParsingHelper::GITHUB_OLD_REGEX = T.let(T.unsafe(nil), Regexp)
2531
+ Danger::Helpers::CommentsParsingHelper::NEW_REGEX = T.let(T.unsafe(nil), Regexp)
2532
+
2533
+ module Danger::Helpers::MessageGroupsArrayHelper
2534
+ def counts; end
2535
+ def fake_errors_array; end
2536
+ def fake_warnings_array; end
2537
+ end
2538
+
2539
+ class Danger::Helpers::MessageGroupsArrayHelper::FakeArray < ::Struct
2540
+ # Returns the value of attribute count
2541
+ #
2542
+ # @return [Object] the current value of count
2543
+ def count; end
2544
+
2545
+ # Sets the attribute count
2546
+ #
2547
+ # @param value [Object] the value to set the attribute count to.
2548
+ # @return [Object] the newly set value
2549
+ def count=(_); end
2550
+
2551
+ # @return [Boolean]
2552
+ def empty?; end
2553
+
2554
+ class << self
2555
+ def [](*_arg0); end
2556
+ def inspect; end
2557
+ def members; end
2558
+ def new(*_arg0); end
2559
+ end
2560
+ end
2561
+
2562
+ class Danger::Init < ::Danger::Runner
2563
+ # @return [Init] a new instance of Init
2564
+ def initialize(argv); end
2565
+
2566
+ def circle_token; end
2567
+
2568
+ # @return [Boolean]
2569
+ def considered_an_oss_repo?; end
2570
+
2571
+ def current_repo_slug; end
2572
+
2573
+ # @return [Boolean]
2574
+ def darwin?; end
2575
+
2576
+ def info; end
2577
+ def note_about_clicking_links; end
2578
+ def run; end
2579
+ def setup_access_token; end
2580
+ def setup_danger_ci; end
2581
+ def setup_dangerfile; end
2582
+ def setup_github_account; end
2583
+ def show_todo_state; end
2584
+ def thanks; end
2585
+ def travis_token; end
2586
+
2587
+ # Returns the value of attribute ui.
2588
+ def ui; end
2589
+
2590
+ # Sets the attribute ui
2591
+ #
2592
+ # @param value the value to set the attribute ui to.
2593
+ def ui=(_arg0); end
2594
+
2595
+ def unsure_ci; end
2596
+ def unsure_token; end
2597
+ def uses_circle; end
2598
+ def uses_travis; end
2599
+
2600
+ class << self
2601
+ def options; end
2602
+ end
2603
+ end
2604
+
2605
+ class Danger::Interviewer
2606
+ # @return [Interviewer] a new instance of Interviewer
2607
+ def initialize(cork_board); end
2608
+
2609
+ def ask_with_answers(question, possible_answers); end
2610
+ def green_bang; end
2611
+ def header(title); end
2612
+ def link(url); end
2613
+
2614
+ # Returns the value of attribute no_delay.
2615
+ def no_delay; end
2616
+
2617
+ # Sets the attribute no_delay
2618
+ #
2619
+ # @param value the value to set the attribute no_delay to.
2620
+ def no_delay=(_arg0); end
2621
+
2622
+ # Returns the value of attribute no_waiting.
2623
+ def no_waiting; end
2624
+
2625
+ # Sets the attribute no_waiting
2626
+ #
2627
+ # @param value the value to set the attribute no_waiting to.
2628
+ def no_waiting=(_arg0); end
2629
+
2630
+ def pause(time); end
2631
+ def red_bang; end
2632
+ def run_command(command, output_command = T.unsafe(nil)); end
2633
+ def say(output); end
2634
+ def show_prompt; end
2635
+
2636
+ # Returns the value of attribute ui.
2637
+ def ui; end
2638
+
2639
+ # Sets the attribute ui
2640
+ #
2641
+ # @param value the value to set the attribute ui to.
2642
+ def ui=(_arg0); end
2643
+
2644
+ def wait_for_return; end
2645
+ def yellow_bang; end
2646
+ end
2647
+
2648
+ # ### CI Setup
2649
+ # Ah Jenkins, so many memories. So, if you're using Jenkins, you're hosting your own environment.
2650
+ #
2651
+ # #### GitHub
2652
+ # You will want to be using the [GitHub pull request builder plugin](https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin)
2653
+ # in order to ensure that you have the build environment set up for PR integration.
2654
+ #
2655
+ # With that set up, you can edit your job to add `bundle exec danger` at the build action.
2656
+ #
2657
+ # ##### Pipeline
2658
+ # If your're using [pipelines](https://jenkins.io/solutions/pipeline/) you should be using the [GitHub branch source plugin](https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Branch+Source+Plugin)
2659
+ # for easy setup and handling of PRs.
2660
+ #
2661
+ # After you've set up the plugin, add a `sh 'bundle exec danger'` line in your pipeline script and make sure that build PRs is enabled.
2662
+ #
2663
+ # #### GitLab
2664
+ # You will want to be using the [GitLab Plugin](https://github.com/jenkinsci/gitlab-plugin)
2665
+ # in order to ensure that you have the build environment set up for MR integration.
2666
+ #
2667
+ # With that set up, you can edit your job to add `bundle exec danger` at the build action.
2668
+ #
2669
+ # #### General
2670
+ #
2671
+ # People occasionally see issues with Danger not classing your CI runs as a PR, to give you visibilty
2672
+ # the Jenkins side of Danger expects to see one of these env vars:
2673
+ # - ghprbPullId
2674
+ # - CHANGE_ID
2675
+ # - gitlabMergeRequestIid
2676
+ # - gitlabMergeRequestId
2677
+ #
2678
+ # ### Token Setup
2679
+ #
2680
+ # #### GitHub
2681
+ # As you own the machine, it's up to you to add the environment variable for the `DANGER_GITHUB_API_TOKEN`.
2682
+ #
2683
+ # #### GitLab
2684
+ # As you own the machine, it's up to you to add the environment variable for the `DANGER_GITLAB_API_TOKEN`.
2685
+ class Danger::Jenkins < ::Danger::CI
2686
+ # @raise [EnvNotFound]
2687
+ # @return [Jenkins] a new instance of Jenkins
2688
+ def initialize(env); end
2689
+
2690
+ # Returns the value of attribute project_url.
2691
+ def project_url; end
2692
+
2693
+ # Sets the attribute project_url
2694
+ #
2695
+ # @param value the value to set the attribute project_url to.
2696
+ def project_url=(_arg0); end
2697
+
2698
+ def supported_request_sources; end
2699
+
2700
+ class << self
2701
+ def pull_request_id(env); end
2702
+ def repo_slug(repo_url); end
2703
+ def repo_url(env); end
2704
+ def slug_bitbucket(repo_url); end
2705
+ def slug_fallback(repo_url); end
2706
+ def slug_http(repo_url); end
2707
+ def slug_ssh(repo_url); end
2708
+
2709
+ # @return [Boolean]
2710
+ def validates_as_ci?(env); end
2711
+
2712
+ # @return [Boolean]
2713
+ def validates_as_pr?(env); end
2714
+ end
2715
+ end
2716
+
2717
+ class Danger::Jenkins::EnvNotFound < ::StandardError
2718
+ # @return [EnvNotFound] a new instance of EnvNotFound
2719
+ def initialize; end
2720
+ end
2721
+
2722
+ class Danger::Local < ::Danger::Runner
2723
+ # @return [Local] a new instance of Local
2724
+ def initialize(argv); end
2725
+
2726
+ def run; end
2727
+ def validate!; end
2728
+
2729
+ private
2730
+
2731
+ #  this method is a duplicate of Commands::PR#configure_octokit
2732
+ # - worth a refactor sometime?
2733
+ def configure_octokit(cache_dir); end
2734
+
2735
+ class << self
2736
+ def options; end
2737
+ end
2738
+ end
2739
+
2740
+ # ignore
2741
+ class Danger::LocalGitRepo < ::Danger::CI
2742
+ # @return [LocalGitRepo] a new instance of LocalGitRepo
2743
+ def initialize(env = T.unsafe(nil)); end
2744
+
2745
+ # Returns the value of attribute base_commit.
2746
+ def base_commit; end
2747
+
2748
+ # Sets the attribute base_commit
2749
+ #
2750
+ # @param value the value to set the attribute base_commit to.
2751
+ def base_commit=(_arg0); end
2752
+
2753
+ def git; end
2754
+
2755
+ # Returns the value of attribute head_commit.
2756
+ def head_commit; end
2757
+
2758
+ # Sets the attribute head_commit
2759
+ #
2760
+ # @param value the value to set the attribute head_commit to.
2761
+ def head_commit=(_arg0); end
2762
+
2763
+ def run_git(command); end
2764
+ def supported_request_sources; end
2765
+
2766
+ private
2767
+
2768
+ def commits; end
2769
+ def find_pull_request(env); end
2770
+ def find_remote_info(env); end
2771
+
2772
+ # Returns the value of attribute found_pull_request.
2773
+ def found_pull_request; end
2774
+
2775
+ # @return [Boolean]
2776
+ def given_pull_request_url?(env); end
2777
+
2778
+ def missing_remote_error_message; end
2779
+ def raise_error_for_missing_remote; end
2780
+
2781
+ # Returns the value of attribute remote_info.
2782
+ def remote_info; end
2783
+
2784
+ def sha; end
2785
+
2786
+ class << self
2787
+ # @return [Boolean]
2788
+ def validates_as_ci?(env); end
2789
+
2790
+ # @return [Boolean]
2791
+ def validates_as_pr?(_env); end
2792
+ end
2793
+ end
2794
+
2795
+ # ### CI Setup
2796
+ #
2797
+ # For setting up LocalOnlyGitRepo there is not much needed. Either `--base` and `--head` need to be specified or
2798
+ # origin/master is expected for base and HEAD for head
2799
+ class Danger::LocalOnlyGitRepo < ::Danger::CI
2800
+ # @return [LocalOnlyGitRepo] a new instance of LocalOnlyGitRepo
2801
+ def initialize(env = T.unsafe(nil)); end
2802
+
2803
+ # Returns the value of attribute base_commit.
2804
+ def base_commit; end
2805
+
2806
+ # Sets the attribute base_commit
2807
+ #
2808
+ # @param value the value to set the attribute base_commit to.
2809
+ def base_commit=(_arg0); end
2810
+
2811
+ def git; end
2812
+
2813
+ # Returns the value of attribute head_commit.
2814
+ def head_commit; end
2815
+
2816
+ # Sets the attribute head_commit
2817
+ #
2818
+ # @param value the value to set the attribute head_commit to.
2819
+ def head_commit=(_arg0); end
2820
+
2821
+ def run_git(command); end
2822
+ def supported_request_sources; end
2823
+
2824
+ class << self
2825
+ # @return [Boolean]
2826
+ def validates_as_ci?(env); end
2827
+
2828
+ # @return [Boolean]
2829
+ def validates_as_pr?(_env); end
2830
+ end
2831
+ end
2832
+
2833
+ Danger::LocalOnlyGitRepo::BASE_VAR = T.let(T.unsafe(nil), String)
2834
+ Danger::LocalOnlyGitRepo::HEAD_VAR = T.let(T.unsafe(nil), String)
2835
+
2836
+ class Danger::LocalPullRequest
2837
+ # @return [LocalPullRequest] a new instance of LocalPullRequest
2838
+ def initialize(log_line); end
2839
+
2840
+ # Returns the value of attribute pull_request_id.
2841
+ def pull_request_id; end
2842
+
2843
+ # Returns the value of attribute sha.
2844
+ def sha; end
2845
+
2846
+ # @return [Boolean]
2847
+ def valid?; end
2848
+ end
2849
+
2850
+ class Danger::LocalSetup
2851
+ # @return [LocalSetup] a new instance of LocalSetup
2852
+ def initialize(dangerfile, cork); end
2853
+
2854
+ # Returns the value of attribute cork.
2855
+ def cork; end
2856
+
2857
+ # Returns the value of attribute dm.
2858
+ def dm; end
2859
+
2860
+ def setup(verbose: T.unsafe(nil)); end
2861
+ end
2862
+
2863
+ class Danger::Markdown < ::Danger::BaseMessage
2864
+ # @return [Markdown] a new instance of Markdown
2865
+ def initialize(message, file = T.unsafe(nil), line = T.unsafe(nil)); end
2866
+
2867
+ def <=>(other); end
2868
+ def ==(other); end
2869
+ def hash; end
2870
+ def to_s; end
2871
+ end
2872
+
2873
+ class Danger::MessageAggregator
2874
+ # @return [MessageAggregator] a new instance of MessageAggregator
2875
+ def initialize(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), danger_id: T.unsafe(nil)); end
2876
+
2877
+ # aggregates the messages into an array of MessageGroups
2878
+ #
2879
+ # @return [[MessageGroup]]
2880
+ def aggregate; end
2881
+
2882
+ class << self
2883
+ def aggregate(*args); end
2884
+ end
2885
+ end
2886
+
2887
+ class Danger::MessageGroup
2888
+ # @return [MessageGroup] a new instance of MessageGroup
2889
+ def initialize(file: T.unsafe(nil), line: T.unsafe(nil)); end
2890
+
2891
+ # Adds a message to the group.
2892
+ #
2893
+ # @param message [Markdown, Violation] the message to add
2894
+ def <<(message); end
2895
+
2896
+ # Returns the value of attribute file.
2897
+ def file; end
2898
+
2899
+ # Returns the value of attribute line.
2900
+ def line; end
2901
+
2902
+ def markdowns; end
2903
+
2904
+ # Merges two `MessageGroup`s that represent the same line of code
2905
+ # In future, perhaps `MessageGroup` will be able to represent a group of
2906
+ # messages for multiple lines.
2907
+ #
2908
+ # @raise [ArgumentError]
2909
+ def merge(other); end
2910
+
2911
+ # The list of messages in this group. This list will be sorted in decreasing
2912
+ # order of severity (error, warning, message, markdown)
2913
+ def messages; end
2914
+
2915
+ # Returns whether this `MessageGroup` is for the same line of code as
2916
+ # `other`, taking which file they are in to account.
2917
+ #
2918
+ # @param other [MessageGroup, Markdown, Violation]
2919
+ # @return [Boolean] whether this `MessageGroup` is for the same line of code
2920
+ def same_line?(other); end
2921
+
2922
+ # :errors_count
2923
+ #
2924
+ # @return a hash of statistics. Currently only :warnings_count and
2925
+ def stats; end
2926
+ end
2927
+
2928
+ class Danger::NoPullRequest
2929
+ # @return [Boolean]
2930
+ def valid?; end
2931
+ end
2932
+
2933
+ class Danger::NoRepoInfo
2934
+ # Returns the value of attribute id.
2935
+ def id; end
2936
+
2937
+ # Returns the value of attribute slug.
2938
+ def slug; end
2939
+ end
2940
+
2941
+ class Danger::PR < ::Danger::Runner
2942
+ # @return [PR] a new instance of PR
2943
+ def initialize(argv); end
2944
+
2945
+ def run; end
2946
+ def validate!; end
2947
+
2948
+ private
2949
+
2950
+ def configure_octokit(cache_dir); end
2951
+
2952
+ class << self
2953
+ def options; end
2954
+ end
2955
+ end
2956
+
2957
+ class Danger::Plugin
2958
+ # @return [Plugin] a new instance of Plugin
2959
+ def initialize(dangerfile); end
2960
+
2961
+ def method_missing(method_sym, *arguments, **keyword_arguments, &block); end
2962
+
2963
+ private
2964
+
2965
+ # When using `danger local --pry`, every plugin had an unreasonable
2966
+ # amount of text output due to the Dangerfile reference in every
2967
+ # plugin. So, it is filtered out. Users will start out in the context
2968
+ # of the Dangerfile, and can view it by just typing `self` into the REPL.
2969
+ def pretty_print_instance_variables; end
2970
+
2971
+ class << self
2972
+ def all_plugins; end
2973
+ def clear_external_plugins; end
2974
+
2975
+ # @private
2976
+ def inherited(plugin); end
2977
+
2978
+ def instance_name; end
2979
+ end
2980
+ end
2981
+
2982
+ class Danger::PluginFileResolver
2983
+ # Takes an array of files, gems or nothing, then resolves them into
2984
+ # paths that should be sent into the documentation parser
2985
+ #
2986
+ # @return [PluginFileResolver] a new instance of PluginFileResolver
2987
+ def initialize(references); end
2988
+
2989
+ # When given existing paths, map to absolute & existing paths
2990
+ # When given a list of gems, resolve for list of gems
2991
+ # When empty, imply you want to test the current lib folder as a plugin
2992
+ def resolve; end
2993
+
2994
+ private
2995
+
2996
+ # Returns the value of attribute refs.
2997
+ def refs; end
2998
+ end
2999
+
3000
+ class Danger::PluginJSON < ::CLAide::Command::Plugins
3001
+ # @return [PluginJSON] a new instance of PluginJSON
3002
+ def initialize(argv); end
3003
+
3004
+ # Returns the value of attribute cork.
3005
+ def cork; end
3006
+
3007
+ # Sets the attribute cork
3008
+ #
3009
+ # @param value the value to set the attribute cork to.
3010
+ def cork=(_arg0); end
3011
+
3012
+ def run; end
3013
+ end
3014
+
3015
+ class Danger::PluginLint < ::CLAide::Command::Plugins
3016
+ # @return [PluginLint] a new instance of PluginLint
3017
+ def initialize(argv); end
3018
+
3019
+ # Returns the value of attribute cork.
3020
+ def cork; end
3021
+
3022
+ # Sets the attribute cork
3023
+ #
3024
+ # @param value the value to set the attribute cork to.
3025
+ def cork=(_arg0); end
3026
+
3027
+ def run; end
3028
+
3029
+ class << self
3030
+ def options; end
3031
+ end
3032
+ end
3033
+
3034
+ class Danger::PluginLinter
3035
+ # @return [PluginLinter] a new instance of PluginLinter
3036
+ def initialize(json); end
3037
+
3038
+ # Returns the value of attribute errors.
3039
+ def errors; end
3040
+
3041
+ # Sets the attribute errors
3042
+ #
3043
+ # @param value the value to set the attribute errors to.
3044
+ def errors=(_arg0); end
3045
+
3046
+ # Did the linter pass/fail?
3047
+ #
3048
+ # @return [Boolean]
3049
+ def failed?; end
3050
+
3051
+ # Returns the value of attribute json.
3052
+ def json; end
3053
+
3054
+ # Sets the attribute json
3055
+ #
3056
+ # @param value the value to set the attribute json to.
3057
+ def json=(_arg0); end
3058
+
3059
+ # Lints the current JSON, looking at:
3060
+ # * Class rules
3061
+ # * Method rules
3062
+ # * Attribute rules
3063
+ def lint; end
3064
+
3065
+ # Prints a summary of the errors and warnings.
3066
+ def print_summary(ui); end
3067
+
3068
+ # Returns the value of attribute warnings.
3069
+ def warnings; end
3070
+
3071
+ # Sets the attribute warnings
3072
+ #
3073
+ # @param value the value to set the attribute warnings to.
3074
+ def warnings=(_arg0); end
3075
+
3076
+ private
3077
+
3078
+ # Runs the rule, if it fails then additional metadata
3079
+ # is added to the rule (for printing later) and it's
3080
+ # added to either `warnings` or `errors`.
3081
+ def apply_rules(json, type, rules); end
3082
+
3083
+ # Rules that apply to a class
3084
+ def class_rules; end
3085
+
3086
+ # Generates a link to see an example of said rule
3087
+ def link(ref); end
3088
+
3089
+ # Rules that apply to individual methods, and attributes
3090
+ def method_rules; end
3091
+ end
3092
+
3093
+ # An internal class that is used to represent a rule for the linter.
3094
+ class Danger::PluginLinter::Rule
3095
+ # @return [Rule] a new instance of Rule
3096
+ def initialize(modifier, ref, title, description, function); end
3097
+
3098
+ # Returns the value of attribute description.
3099
+ def description; end
3100
+
3101
+ # Sets the attribute description
3102
+ #
3103
+ # @param value the value to set the attribute description to.
3104
+ def description=(_arg0); end
3105
+
3106
+ # Returns the value of attribute function.
3107
+ def function; end
3108
+
3109
+ # Sets the attribute function
3110
+ #
3111
+ # @param value the value to set the attribute function to.
3112
+ def function=(_arg0); end
3113
+
3114
+ # Returns the value of attribute metadata.
3115
+ def metadata; end
3116
+
3117
+ # Sets the attribute metadata
3118
+ #
3119
+ # @param value the value to set the attribute metadata to.
3120
+ def metadata=(_arg0); end
3121
+
3122
+ # Returns the value of attribute modifier.
3123
+ def modifier; end
3124
+
3125
+ # Sets the attribute modifier
3126
+ #
3127
+ # @param value the value to set the attribute modifier to.
3128
+ def modifier=(_arg0); end
3129
+
3130
+ def object_applied_to; end
3131
+
3132
+ # Returns the value of attribute ref.
3133
+ def ref; end
3134
+
3135
+ # Sets the attribute ref
3136
+ #
3137
+ # @param value the value to set the attribute ref to.
3138
+ def ref=(_arg0); end
3139
+
3140
+ # Returns the value of attribute title.
3141
+ def title; end
3142
+
3143
+ # Sets the attribute title
3144
+ #
3145
+ # @param value the value to set the attribute title to.
3146
+ def title=(_arg0); end
3147
+
3148
+ # Returns the value of attribute type.
3149
+ def type; end
3150
+
3151
+ # Sets the attribute type
3152
+ #
3153
+ # @param value the value to set the attribute type to.
3154
+ def type=(_arg0); end
3155
+ end
3156
+
3157
+ class Danger::PluginParser
3158
+ # @return [PluginParser] a new instance of PluginParser
3159
+ def initialize(paths, verbose = T.unsafe(nil)); end
3160
+
3161
+ def attribute_parser(gem_path, attribute); end
3162
+ def classes_in_file; end
3163
+ def method_params(method); end
3164
+ def method_parser(gem_path, meth); end
3165
+ def method_return_string(meth); end
3166
+ def parse; end
3167
+ def plugins_from_classes(classes); end
3168
+
3169
+ # Returns the value of attribute registry.
3170
+ def registry; end
3171
+
3172
+ # Sets the attribute registry
3173
+ #
3174
+ # @param value the value to set the attribute registry to.
3175
+ def registry=(_arg0); end
3176
+
3177
+ def setup_yard(verbose); end
3178
+ def to_h(classes); end
3179
+ def to_json; end
3180
+ def to_json_string; end
3181
+ end
3182
+
3183
+ class Danger::PluginReadme < ::CLAide::Command::Plugins
3184
+ # @return [PluginReadme] a new instance of PluginReadme
3185
+ def initialize(argv); end
3186
+
3187
+ # Returns the value of attribute cork.
3188
+ def cork; end
3189
+
3190
+ # Sets the attribute cork
3191
+ #
3192
+ # @param value the value to set the attribute cork to.
3193
+ def cork=(_arg0); end
3194
+
3195
+ # Returns the value of attribute json.
3196
+ def json; end
3197
+
3198
+ # Sets the attribute json
3199
+ #
3200
+ # @param value the value to set the attribute json to.
3201
+ def json=(_arg0); end
3202
+
3203
+ # Returns the value of attribute markdown.
3204
+ def markdown; end
3205
+
3206
+ # Sets the attribute markdown
3207
+ #
3208
+ # @param value the value to set the attribute markdown to.
3209
+ def markdown=(_arg0); end
3210
+
3211
+ def run; end
3212
+ end
3213
+
3214
+ class Danger::PrySetup
3215
+ # @return [PrySetup] a new instance of PrySetup
3216
+ def initialize(cork); end
3217
+
3218
+ def setup_pry(dangerfile_path, command); end
3219
+
3220
+ private
3221
+
3222
+ # Returns the value of attribute cork.
3223
+ def cork; end
3224
+
3225
+ def validate_pry_available(command); end
3226
+ end
3227
+
3228
+ Danger::PrySetup::DANGERFILE_COPY = T.let(T.unsafe(nil), String)
3229
+
3230
+ class Danger::PullRequestFinder
3231
+ # @return [PullRequestFinder] a new instance of PullRequestFinder
3232
+ def initialize(specific_pull_request_id, repo_slug = T.unsafe(nil), remote: T.unsafe(nil), git_logs: T.unsafe(nil), remote_url: T.unsafe(nil)); end
3233
+
3234
+ def call(env: T.unsafe(nil)); end
3235
+
3236
+ private
3237
+
3238
+ def api_url; end
3239
+
3240
+ # @return [Boolean]
3241
+ def both_present?; end
3242
+
3243
+ def client(env); end
3244
+
3245
+ # @return [String] Log line of most recent merged Pull Request
3246
+ def find_pull_request(env); end
3247
+
3248
+ def find_remote_pull_request(env); end
3249
+ def find_scm_provider(remote_url); end
3250
+ def generate_remote_pull_request(remote_pull_request); end
3251
+
3252
+ # Returns the value of attribute git_logs.
3253
+ def git_logs; end
3254
+
3255
+ # @return [String] Log line of format: "Merge pull request #42"
3256
+ def most_recent_merged_pull_request; end
3257
+
3258
+ # @return [String] Log line of format: "description (#42)"
3259
+ def most_recent_squash_and_merged_pull_request; end
3260
+
3261
+ # @return [Boolean]
3262
+ def only_merged_pull_request_present?; end
3263
+
3264
+ # @return [Boolean]
3265
+ def only_squash_and_merged_pull_request_present?; end
3266
+
3267
+ def pick_the_most_recent_one_from_two_matches; end
3268
+
3269
+ # @return [String] "#42"
3270
+ def pull_request_ref; end
3271
+
3272
+ def raise_pull_request_not_found!(pull_request); end
3273
+
3274
+ # Returns the value of attribute remote.
3275
+ def remote; end
3276
+
3277
+ # Returns the value of attribute remote_url.
3278
+ def remote_url; end
3279
+
3280
+ # Returns the value of attribute repo_slug.
3281
+ def repo_slug; end
3282
+
3283
+ # Returns the value of attribute specific_pull_request_id.
3284
+ def specific_pull_request_id; end
3285
+
3286
+ def to_boolean(maybe_string); end
3287
+ end
3288
+
3289
+ class Danger::RemotePullRequest
3290
+ # @return [RemotePullRequest] a new instance of RemotePullRequest
3291
+ def initialize(pull_request_id, head, base); end
3292
+
3293
+ # Returns the value of attribute base.
3294
+ def base; end
3295
+
3296
+ # Returns the value of attribute head.
3297
+ def head; end
3298
+
3299
+ # Returns the value of attribute pull_request_id.
3300
+ def pull_request_id; end
3301
+
3302
+ # Returns the value of attribute sha.
3303
+ def sha; end
3304
+
3305
+ # @return [Boolean]
3306
+ def valid?; end
3307
+ end
3308
+
3309
+ class Danger::RepoInfo
3310
+ # @return [RepoInfo] a new instance of RepoInfo
3311
+ def initialize(slug, id); end
3312
+
3313
+ # Returns the value of attribute id.
3314
+ def id; end
3315
+
3316
+ # Returns the value of attribute slug.
3317
+ def slug; end
3318
+ end
3319
+
3320
+ module Danger::RequestSources; end
3321
+
3322
+ class Danger::RequestSources::BitbucketCloud < ::Danger::RequestSources::RequestSource
3323
+ include ::Danger::Helpers::CommentsParsingHelper
3324
+ include ::Danger::Helpers::CommentsHelper
3325
+
3326
+ # @return [BitbucketCloud] a new instance of BitbucketCloud
3327
+ def initialize(ci_source, environment); end
3328
+
3329
+ def delete_old_comments(danger_id: T.unsafe(nil)); end
3330
+ def fetch_details; end
3331
+ def host; end
3332
+ def organisation; end
3333
+
3334
+ # Returns the value of attribute pr_json.
3335
+ def pr_json; end
3336
+
3337
+ # Sets the attribute pr_json
3338
+ #
3339
+ # @param value the value to set the attribute pr_json to.
3340
+ def pr_json=(_arg0); end
3341
+
3342
+ def scm; end
3343
+ def setup_danger_branches; end
3344
+ def update_inline_comments_for_kind!(kind, messages, danger_id: T.unsafe(nil)); end
3345
+ def update_pr_by_line!(message_groups:, danger_id: T.unsafe(nil), new_comment: T.unsafe(nil), remove_previous_comments: T.unsafe(nil)); end
3346
+ def update_pull_request!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), danger_id: T.unsafe(nil), new_comment: T.unsafe(nil), remove_previous_comments: T.unsafe(nil)); end
3347
+
3348
+ # @return [Boolean]
3349
+ def validates_as_api_source?; end
3350
+
3351
+ # @return [Boolean]
3352
+ def validates_as_ci?; end
3353
+
3354
+ class << self
3355
+ def env_vars; end
3356
+ def optional_env_vars; end
3357
+ end
3358
+ end
3359
+
3360
+ class Danger::RequestSources::BitbucketCloudAPI
3361
+ # @return [BitbucketCloudAPI] a new instance of BitbucketCloudAPI
3362
+ def initialize(repo_slug, pull_request_id, branch_name, environment); end
3363
+
3364
+ # Returns the value of attribute access_token.
3365
+ def access_token; end
3366
+
3367
+ # Sets the attribute access_token
3368
+ #
3369
+ # @param value the value to set the attribute access_token to.
3370
+ def access_token=(_arg0); end
3371
+
3372
+ # @return [Boolean]
3373
+ def credentials_given?; end
3374
+
3375
+ def delete_comment(id); end
3376
+ def fetch_comments; end
3377
+ def fetch_pr_json; end
3378
+
3379
+ # Returns the value of attribute host.
3380
+ def host; end
3381
+
3382
+ # Sets the attribute host
3383
+ #
3384
+ # @param value the value to set the attribute host to.
3385
+ def host=(_arg0); end
3386
+
3387
+ def initialize_my_uuid(uuid); end
3388
+ def inspect; end
3389
+
3390
+ # Returns the value of attribute my_uuid.
3391
+ def my_uuid; end
3392
+
3393
+ def post_comment(text, file: T.unsafe(nil), line: T.unsafe(nil)); end
3394
+
3395
+ # Returns the value of attribute project.
3396
+ def project; end
3397
+
3398
+ # Sets the attribute project
3399
+ #
3400
+ # @param value the value to set the attribute project to.
3401
+ def project=(_arg0); end
3402
+
3403
+ def pull_request(*_arg0); end
3404
+
3405
+ # Returns the value of attribute pull_request_id.
3406
+ def pull_request_id; end
3407
+
3408
+ # Sets the attribute pull_request_id
3409
+ #
3410
+ # @param value the value to set the attribute pull_request_id to.
3411
+ def pull_request_id=(_arg0); end
3412
+
3413
+ # Returns the value of attribute slug.
3414
+ def slug; end
3415
+
3416
+ # Sets the attribute slug
3417
+ #
3418
+ # @param value the value to set the attribute slug to.
3419
+ def slug=(_arg0); end
3420
+
3421
+ private
3422
+
3423
+ def base_url(version); end
3424
+ def credentials_not_available; end
3425
+ def delete(uri); end
3426
+ def error_fetching_json(url, status_code); end
3427
+ def fetch_access_token(environment); end
3428
+ def fetch_json(uri); end
3429
+ def fetch_pr_from_branch(branch_name); end
3430
+ def post(uri, body); end
3431
+ def pr_api_endpoint; end
3432
+ def prs_api_url(branch_name); end
3433
+ end
3434
+
3435
+ class Danger::RequestSources::BitbucketServer < ::Danger::RequestSources::RequestSource
3436
+ include ::Danger::Helpers::CommentsParsingHelper
3437
+ include ::Danger::Helpers::CommentsHelper
3438
+
3439
+ # @return [BitbucketServer] a new instance of BitbucketServer
3440
+ def initialize(ci_source, environment); end
3441
+
3442
+ def added_lines(file); end
3443
+ def delete_old_comments(danger_id: T.unsafe(nil)); end
3444
+
3445
+ # Returns the value of attribute dismiss_out_of_range_messages.
3446
+ def dismiss_out_of_range_messages; end
3447
+
3448
+ # Sets the attribute dismiss_out_of_range_messages
3449
+ #
3450
+ # @param value the value to set the attribute dismiss_out_of_range_messages to.
3451
+ def dismiss_out_of_range_messages=(_arg0); end
3452
+
3453
+ def fetch_details; end
3454
+ def file_diff(file); end
3455
+
3456
+ # @return [Boolean]
3457
+ def find_position_in_diff?(file, line); end
3458
+
3459
+ def host; end
3460
+ def inline_violations_group(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil)); end
3461
+ def main_violations_group(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil)); end
3462
+ def organisation; end
3463
+ def pr_diff; end
3464
+
3465
+ # Returns the value of attribute pr_json.
3466
+ def pr_json; end
3467
+
3468
+ # Sets the attribute pr_json
3469
+ #
3470
+ # @param value the value to set the attribute pr_json to.
3471
+ def pr_json=(_arg0); end
3472
+
3473
+ def scm; end
3474
+ def setup_danger_branches; end
3475
+ def update_pr_build_status(status, build_job_link, description); end
3476
+ def update_pull_request!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), danger_id: T.unsafe(nil), new_comment: T.unsafe(nil), remove_previous_comments: T.unsafe(nil)); end
3477
+
3478
+ # @return [Boolean]
3479
+ def validates_as_api_source?; end
3480
+
3481
+ # @return [Boolean]
3482
+ def validates_as_ci?; end
3483
+
3484
+ class << self
3485
+ def env_vars; end
3486
+ def optional_env_vars; end
3487
+ end
3488
+ end
3489
+
3490
+ class Danger::RequestSources::BitbucketServerAPI
3491
+ # @return [BitbucketServerAPI] a new instance of BitbucketServerAPI
3492
+ def initialize(project, slug, pull_request_id, environment); end
3493
+
3494
+ # @return [Boolean]
3495
+ def credentials_given?; end
3496
+
3497
+ def delete_comment(id, version); end
3498
+ def fetch_last_comments; end
3499
+ def fetch_pr_diff; end
3500
+ def fetch_pr_json; end
3501
+
3502
+ # Returns the value of attribute host.
3503
+ def host; end
3504
+
3505
+ # Sets the attribute host
3506
+ #
3507
+ # @param value the value to set the attribute host to.
3508
+ def host=(_arg0); end
3509
+
3510
+ def inspect; end
3511
+
3512
+ # Returns the value of attribute key.
3513
+ def key; end
3514
+
3515
+ # Sets the attribute key
3516
+ #
3517
+ # @param value the value to set the attribute key to.
3518
+ def key=(_arg0); end
3519
+
3520
+ def post_comment(text); end
3521
+
3522
+ # Returns the value of attribute pr_api_endpoint.
3523
+ def pr_api_endpoint; end
3524
+
3525
+ # Sets the attribute pr_api_endpoint
3526
+ #
3527
+ # @param value the value to set the attribute pr_api_endpoint to.
3528
+ def pr_api_endpoint=(_arg0); end
3529
+
3530
+ # Returns the value of attribute project.
3531
+ def project; end
3532
+
3533
+ # Sets the attribute project
3534
+ #
3535
+ # @param value the value to set the attribute project to.
3536
+ def project=(_arg0); end
3537
+
3538
+ def pull_request(*_arg0); end
3539
+ def update_pr_build_status(status, changeset, build_job_link, description); end
3540
+
3541
+ # Returns the value of attribute verify_ssl.
3542
+ def verify_ssl; end
3543
+
3544
+ # Sets the attribute verify_ssl
3545
+ #
3546
+ # @param value the value to set the attribute verify_ssl to.
3547
+ def verify_ssl=(_arg0); end
3548
+
3549
+ private
3550
+
3551
+ def build_status_body(status, build_job_link, description); end
3552
+ def delete(uri); end
3553
+ def fetch_json(uri); end
3554
+ def http(uri); end
3555
+ def post(uri, body); end
3556
+ def use_ssl; end
3557
+ end
3558
+
3559
+ # Provides ability for Danger to interact with Atlassian's Code Insights API in order to provide code quality
3560
+ # reports along with inline comments for specific lines in specific files.
3561
+ # See https://developer.atlassian.com/server/bitbucket/how-tos/code-insights/ for more details.
3562
+ #
3563
+ # Currently this functionality is implemented only for Bitbucket Server request source.
3564
+ class Danger::RequestSources::CodeInsightsAPI
3565
+ # @return [CodeInsightsAPI] a new instance of CodeInsightsAPI
3566
+ def initialize(project, slug, environment); end
3567
+
3568
+ def annotation_endpoint_at_commit(commit); end
3569
+ def delete_report(commit); end
3570
+
3571
+ # Returns the value of attribute host.
3572
+ def host; end
3573
+
3574
+ # Sets the attribute host
3575
+ #
3576
+ # @param value the value to set the attribute host to.
3577
+ def host=(_arg0); end
3578
+
3579
+ def inspect; end
3580
+
3581
+ # Returns the value of attribute logo_url.
3582
+ def logo_url; end
3583
+
3584
+ # Sets the attribute logo_url
3585
+ #
3586
+ # @param value the value to set the attribute logo_url to.
3587
+ def logo_url=(_arg0); end
3588
+
3589
+ # Returns the value of attribute password.
3590
+ def password; end
3591
+
3592
+ # Sets the attribute password
3593
+ #
3594
+ # @param value the value to set the attribute password to.
3595
+ def password=(_arg0); end
3596
+
3597
+ def post_annotations(commit, inline_warnings, inline_errors, inline_messages); end
3598
+ def put_report(commit, inline_errors_count); end
3599
+
3600
+ # @return [Boolean]
3601
+ def ready?; end
3602
+
3603
+ # Returns the value of attribute report_description.
3604
+ def report_description; end
3605
+
3606
+ # Sets the attribute report_description
3607
+ #
3608
+ # @param value the value to set the attribute report_description to.
3609
+ def report_description=(_arg0); end
3610
+
3611
+ def report_endpoint_at_commit(commit); end
3612
+
3613
+ # Returns the value of attribute report_key.
3614
+ def report_key; end
3615
+
3616
+ # Sets the attribute report_key
3617
+ #
3618
+ # @param value the value to set the attribute report_key to.
3619
+ def report_key=(_arg0); end
3620
+
3621
+ # Returns the value of attribute report_title.
3622
+ def report_title; end
3623
+
3624
+ # Sets the attribute report_title
3625
+ #
3626
+ # @param value the value to set the attribute report_title to.
3627
+ def report_title=(_arg0); end
3628
+
3629
+ def send_report(commit, inline_warnings, inline_errors, inline_messages); end
3630
+ def use_ssl; end
3631
+
3632
+ # Returns the value of attribute username.
3633
+ def username; end
3634
+
3635
+ # Sets the attribute username
3636
+ #
3637
+ # @param value the value to set the attribute username to.
3638
+ def username=(_arg0); end
3639
+
3640
+ def violation_hash_with_severity(violation, severity); end
3641
+ end
3642
+
3643
+ class Danger::RequestSources::GitHub < ::Danger::RequestSources::RequestSource
3644
+ include ::Danger::Helpers::CommentsParsingHelper
3645
+ include ::Danger::Helpers::CommentsHelper
3646
+
3647
+ # @return [GitHub] a new instance of GitHub
3648
+ def initialize(ci_source, environment); end
3649
+
3650
+ # Returns the value of attribute api_url.
3651
+ def api_url; end
3652
+
3653
+ # Sets the attribute api_url
3654
+ #
3655
+ # @param value the value to set the attribute api_url to.
3656
+ def api_url=(_arg0); end
3657
+
3658
+ def client; end
3659
+
3660
+ # Get rid of the previously posted comment, to only have the latest one
3661
+ def delete_old_comments!(except: T.unsafe(nil), danger_id: T.unsafe(nil)); end
3662
+
3663
+ # Returns the value of attribute dismiss_out_of_range_messages.
3664
+ def dismiss_out_of_range_messages; end
3665
+
3666
+ # Sets the attribute dismiss_out_of_range_messages
3667
+ #
3668
+ # @param value the value to set the attribute dismiss_out_of_range_messages to.
3669
+ def dismiss_out_of_range_messages=(_arg0); end
3670
+
3671
+ def dismiss_out_of_range_messages_for(kind); end
3672
+ def fetch_details; end
3673
+ def fetch_issue_details(pr_json); end
3674
+
3675
+ # @return [String] A URL to the specific file, ready to be downloaded
3676
+ def file_url(organisation: T.unsafe(nil), repository: T.unsafe(nil), branch: T.unsafe(nil), path: T.unsafe(nil)); end
3677
+
3678
+ def find_position_in_diff(diff_lines, message, kind); end
3679
+ def get_pr_from_branch(repo_name, branch_name, owner); end
3680
+
3681
+ # Returns the value of attribute host.
3682
+ def host; end
3683
+
3684
+ # Sets the attribute host
3685
+ #
3686
+ # @param value the value to set the attribute host to.
3687
+ def host=(_arg0); end
3688
+
3689
+ def ignored_violations_from_pr; end
3690
+ def issue_comments; end
3691
+
3692
+ # Returns the value of attribute issue_json.
3693
+ def issue_json; end
3694
+
3695
+ # Sets the attribute issue_json
3696
+ #
3697
+ # @param value the value to set the attribute issue_json to.
3698
+ def issue_json=(_arg0); end
3699
+
3700
+ def markdown_link_to_message(message, hide_link); end
3701
+ def messages_are_equivalent(m1, m2); end
3702
+
3703
+ # @return [String] The organisation name, is nil if it can't be detected
3704
+ def organisation; end
3705
+
3706
+ # See the tests for examples of data coming in looks like
3707
+ def parse_message_from_row(row); end
3708
+
3709
+ def pr_diff; end
3710
+
3711
+ # Returns the value of attribute pr_json.
3712
+ def pr_json; end
3713
+
3714
+ # Sets the attribute pr_json
3715
+ #
3716
+ # @param value the value to set the attribute pr_json to.
3717
+ def pr_json=(_arg0); end
3718
+
3719
+ def review; end
3720
+ def scm; end
3721
+ def setup_danger_branches; end
3722
+ def submit_inline_comments!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), previous_violations: T.unsafe(nil), danger_id: T.unsafe(nil)); end
3723
+ def submit_inline_comments_for_kind!(kind, messages, diff_lines, danger_comments, previous_violations, danger_id: T.unsafe(nil)); end
3724
+ def submit_pull_request_status!(warnings: T.unsafe(nil), errors: T.unsafe(nil), details_url: T.unsafe(nil), danger_id: T.unsafe(nil)); end
3725
+
3726
+ # Returns the value of attribute support_tokenless_auth.
3727
+ def support_tokenless_auth; end
3728
+
3729
+ # Sets the attribute support_tokenless_auth
3730
+ #
3731
+ # @param value the value to set the attribute support_tokenless_auth to.
3732
+ def support_tokenless_auth=(_arg0); end
3733
+
3734
+ # Sending data to GitHub
3735
+ def update_pull_request!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), danger_id: T.unsafe(nil), new_comment: T.unsafe(nil), remove_previous_comments: T.unsafe(nil)); end
3736
+
3737
+ # Returns the value of attribute use_local_git.
3738
+ def use_local_git; end
3739
+
3740
+ # Sets the attribute use_local_git
3741
+ #
3742
+ # @param value the value to set the attribute use_local_git to.
3743
+ def use_local_git=(_arg0); end
3744
+
3745
+ # @return [Boolean]
3746
+ def validates_as_api_source?; end
3747
+
3748
+ # @return [Boolean]
3749
+ def validates_as_ci?; end
3750
+
3751
+ # Returns the value of attribute verify_ssl.
3752
+ def verify_ssl; end
3753
+
3754
+ # Sets the attribute verify_ssl
3755
+ #
3756
+ # @param value the value to set the attribute verify_ssl to.
3757
+ def verify_ssl=(_arg0); end
3758
+
3759
+ private
3760
+
3761
+ def inline_violations_group(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil)); end
3762
+ def merge_violations(*violation_groups); end
3763
+ def regular_violations_group(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil)); end
3764
+
3765
+ # @return [Boolean]
3766
+ def valid_access_token?; end
3767
+
3768
+ # @return [Boolean]
3769
+ def valid_bearer_token?; end
3770
+
3771
+ class << self
3772
+ def env_vars; end
3773
+ def optional_env_vars; end
3774
+ end
3775
+ end
3776
+
3777
+ module Danger::RequestSources::GitHubSource; end
3778
+
3779
+ class Danger::RequestSources::GitHubSource::Review
3780
+ include ::Danger::Helpers::CommentsParsingHelper
3781
+ include ::Danger::Helpers::CommentsHelper
3782
+
3783
+ # @return [Review] a new instance of Review
3784
+ def initialize(client, ci_source, review_json = T.unsafe(nil)); end
3785
+
3786
+ # Returns the value of attribute body.
3787
+ def body; end
3788
+
3789
+ def fail(message, sticky = T.unsafe(nil), file = T.unsafe(nil), line = T.unsafe(nil)); end
3790
+
3791
+ # @return [Boolean]
3792
+ def generated_by_danger?(danger_id = T.unsafe(nil)); end
3793
+
3794
+ # Returns the value of attribute id.
3795
+ def id; end
3796
+
3797
+ def markdown(message, file = T.unsafe(nil), line = T.unsafe(nil)); end
3798
+ def message(message, sticky = T.unsafe(nil), file = T.unsafe(nil), line = T.unsafe(nil)); end
3799
+
3800
+ # Returns the value of attribute review_json.
3801
+ def review_json; end
3802
+
3803
+ # Starts the new review process
3804
+ def start; end
3805
+
3806
+ # Returns the value of attribute status.
3807
+ def status; end
3808
+
3809
+ # Submits the prepared review
3810
+ def submit; end
3811
+
3812
+ def warn(message, sticky = T.unsafe(nil), file = T.unsafe(nil), line = T.unsafe(nil)); end
3813
+
3814
+ private
3815
+
3816
+ def generate_body(danger_id: T.unsafe(nil)); end
3817
+
3818
+ # The only reason to request changes for the PR is to have errors from Danger
3819
+ # otherwise let's just notify user and we're done
3820
+ def generate_event(violations); end
3821
+
3822
+ def generate_general_violations; end
3823
+ end
3824
+
3825
+ # @see https://developer.github.com/v3/pulls/reviews/ for all possible events
3826
+ Danger::RequestSources::GitHubSource::Review::EVENT_APPROVE = T.let(T.unsafe(nil), String)
3827
+
3828
+ Danger::RequestSources::GitHubSource::Review::EVENT_COMMENT = T.let(T.unsafe(nil), String)
3829
+ Danger::RequestSources::GitHubSource::Review::EVENT_REQUEST_CHANGES = T.let(T.unsafe(nil), String)
3830
+
3831
+ # Current review status, if the review has not been submitted yet -> STATUS_PENDING
3832
+ Danger::RequestSources::GitHubSource::Review::STATUS_APPROVED = T.let(T.unsafe(nil), String)
3833
+
3834
+ Danger::RequestSources::GitHubSource::Review::STATUS_COMMENTED = T.let(T.unsafe(nil), String)
3835
+ Danger::RequestSources::GitHubSource::Review::STATUS_PENDING = T.let(T.unsafe(nil), String)
3836
+ Danger::RequestSources::GitHubSource::Review::STATUS_REQUESTED_CHANGES = T.let(T.unsafe(nil), String)
3837
+
3838
+ class Danger::RequestSources::GitHubSource::ReviewResolver
3839
+ class << self
3840
+ # @return [Boolean]
3841
+ def same_body?(body1, body2); end
3842
+
3843
+ # @return [Boolean]
3844
+ def should_submit?(review, body); end
3845
+ end
3846
+ end
3847
+
3848
+ class Danger::RequestSources::GitHubSource::ReviewUnsupported
3849
+ # @return [ReviewUnsupported] a new instance of ReviewUnsupported
3850
+ def initialize; end
3851
+
3852
+ # Returns the value of attribute body.
3853
+ def body; end
3854
+
3855
+ def fail(message, sticky = T.unsafe(nil), file = T.unsafe(nil), line = T.unsafe(nil)); end
3856
+
3857
+ # Returns the value of attribute id.
3858
+ def id; end
3859
+
3860
+ def markdown(message, file = T.unsafe(nil), line = T.unsafe(nil)); end
3861
+ def message(message, sticky = T.unsafe(nil), file = T.unsafe(nil), line = T.unsafe(nil)); end
3862
+
3863
+ # Returns the value of attribute review_json.
3864
+ def review_json; end
3865
+
3866
+ def start; end
3867
+
3868
+ # Returns the value of attribute status.
3869
+ def status; end
3870
+
3871
+ def submit; end
3872
+ def warn(message, sticky = T.unsafe(nil), file = T.unsafe(nil), line = T.unsafe(nil)); end
3873
+ end
3874
+
3875
+ class Danger::RequestSources::GitLab < ::Danger::RequestSources::RequestSource
3876
+ include ::Danger::Helpers::CommentsParsingHelper
3877
+ include ::Danger::Helpers::CommentsHelper
3878
+
3879
+ # @return [GitLab] a new instance of GitLab
3880
+ def initialize(ci_source, environment); end
3881
+
3882
+ def base_commit; end
3883
+ def client; end
3884
+
3885
+ # Returns the value of attribute commits_json.
3886
+ def commits_json; end
3887
+
3888
+ # Sets the attribute commits_json
3889
+ #
3890
+ # @param value the value to set the attribute commits_json to.
3891
+ def commits_json=(_arg0); end
3892
+
3893
+ def delete_old_comments!(except: T.unsafe(nil), danger_id: T.unsafe(nil)); end
3894
+
3895
+ # Returns the value of attribute dismiss_out_of_range_messages.
3896
+ def dismiss_out_of_range_messages; end
3897
+
3898
+ # Sets the attribute dismiss_out_of_range_messages
3899
+ #
3900
+ # @param value the value to set the attribute dismiss_out_of_range_messages to.
3901
+ def dismiss_out_of_range_messages=(_arg0); end
3902
+
3903
+ def dismiss_out_of_range_messages_for(kind); end
3904
+
3905
+ # Returns the value of attribute endpoint.
3906
+ def endpoint; end
3907
+
3908
+ # Sets the attribute endpoint
3909
+ #
3910
+ # @param value the value to set the attribute endpoint to.
3911
+ def endpoint=(_arg0); end
3912
+
3913
+ def fetch_details; end
3914
+
3915
+ # @return [String] A URL to the specific file, ready to be downloaded
3916
+ def file_url(organisation: T.unsafe(nil), repository: T.unsafe(nil), branch: T.unsafe(nil), path: T.unsafe(nil)); end
3917
+
3918
+ def find_old_position_in_diff(changes, message); end
3919
+ def generate_addition_lines(diff); end
3920
+
3921
+ # Returns the value of attribute host.
3922
+ def host; end
3923
+
3924
+ # Sets the attribute host
3925
+ #
3926
+ # @param value the value to set the attribute host to.
3927
+ def host=(_arg0); end
3928
+
3929
+ def ignored_violations_from_pr; end
3930
+ def inline_violations_group(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil)); end
3931
+ def is_out_of_range(changes, message); end
3932
+ def markdown_link_to_message(message, _); end
3933
+ def merge_violations(*violation_groups); end
3934
+ def mr_changed_paths; end
3935
+ def mr_changes; end
3936
+ def mr_closes_issues; end
3937
+ def mr_comments; end
3938
+ def mr_diff; end
3939
+ def mr_discussions; end
3940
+
3941
+ # Returns the value of attribute mr_json.
3942
+ def mr_json; end
3943
+
3944
+ # Sets the attribute mr_json
3945
+ #
3946
+ # @param value the value to set the attribute mr_json to.
3947
+ def mr_json=(_arg0); end
3948
+
3949
+ # @return [String] The organisation name, is nil if it can't be detected
3950
+ def organisation; end
3951
+
3952
+ def regular_violations_group(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil)); end
3953
+ def scm; end
3954
+ def setup_danger_branches; end
3955
+ def submit_inline_comments!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), previous_violations: T.unsafe(nil), danger_id: T.unsafe(nil)); end
3956
+ def submit_inline_comments_for_kind!(kind, messages, diff_lines, danger_comments, previous_violations, danger_id: T.unsafe(nil)); end
3957
+ def supports_inline_comments; end
3958
+ def update_pull_request!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), danger_id: T.unsafe(nil), new_comment: T.unsafe(nil), remove_previous_comments: T.unsafe(nil)); end
3959
+ def update_pull_request_with_inline_comments!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), danger_id: T.unsafe(nil), new_comment: T.unsafe(nil), remove_previous_comments: T.unsafe(nil)); end
3960
+ def update_pull_request_without_inline_comments!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), danger_id: T.unsafe(nil), new_comment: T.unsafe(nil), remove_previous_comments: T.unsafe(nil)); end
3961
+
3962
+ # @return [Boolean]
3963
+ def validates_as_api_source?; end
3964
+
3965
+ # @return [Boolean]
3966
+ def validates_as_ci?; end
3967
+
3968
+ class << self
3969
+ def env_vars; end
3970
+ def optional_env_vars; end
3971
+ end
3972
+ end
3973
+
3974
+ Danger::RequestSources::GitLab::FIRST_GITLAB_GEM_WITH_VERSION_CHECK = T.let(T.unsafe(nil), Gem::Version)
3975
+ Danger::RequestSources::GitLab::FIRST_VERSION_WITH_INLINE_COMMENTS = T.let(T.unsafe(nil), Gem::Version)
3976
+
3977
+ class Danger::RequestSources::LocalOnly < ::Danger::RequestSources::RequestSource
3978
+ include ::Danger::Helpers::CommentsParsingHelper
3979
+ include ::Danger::Helpers::CommentsHelper
3980
+
3981
+ # @return [LocalOnly] a new instance of LocalOnly
3982
+ def initialize(ci_source, _environment); end
3983
+
3984
+ # Returns the value of attribute commits_json.
3985
+ def commits_json; end
3986
+
3987
+ # Sets the attribute commits_json
3988
+ #
3989
+ # @param value the value to set the attribute commits_json to.
3990
+ def commits_json=(_arg0); end
3991
+
3992
+ def fetch_details; end
3993
+
3994
+ # Returns the value of attribute mr_json.
3995
+ def mr_json; end
3996
+
3997
+ # Sets the attribute mr_json
3998
+ #
3999
+ # @param value the value to set the attribute mr_json to.
4000
+ def mr_json=(_arg0); end
4001
+
4002
+ # @return [String] The organisation name, is nil if it can't be detected
4003
+ def organisation; end
4004
+
4005
+ def scm; end
4006
+ def setup_danger_branches; end
4007
+ def update_pull_request!(_hash_needed); end
4008
+
4009
+ # @return [Boolean]
4010
+ def validates_as_api_source?; end
4011
+
4012
+ # @return [Boolean]
4013
+ def validates_as_ci?; end
4014
+
4015
+ class << self
4016
+ def env_vars; end
4017
+ end
4018
+ end
4019
+
4020
+ class Danger::RequestSources::RequestSource
4021
+ # @return [RequestSource] a new instance of RequestSource
4022
+ def initialize(_ci_source, _environment); end
4023
+
4024
+ # Returns the value of attribute ci_source.
4025
+ def ci_source; end
4026
+
4027
+ # Sets the attribute ci_source
4028
+ #
4029
+ # @param value the value to set the attribute ci_source to.
4030
+ def ci_source=(_arg0); end
4031
+
4032
+ def fetch_details; end
4033
+ def file_url(_organisation: T.unsafe(nil), _repository: T.unsafe(nil), _branch: T.unsafe(nil), _path: T.unsafe(nil)); end
4034
+
4035
+ # Returns the value of attribute host.
4036
+ def host; end
4037
+
4038
+ # Sets the attribute host
4039
+ #
4040
+ # @param value the value to set the attribute host to.
4041
+ def host=(_arg0); end
4042
+
4043
+ # Returns the value of attribute ignored_violations.
4044
+ def ignored_violations; end
4045
+
4046
+ # Sets the attribute ignored_violations
4047
+ #
4048
+ # @param value the value to set the attribute ignored_violations to.
4049
+ def ignored_violations=(_arg0); end
4050
+
4051
+ def inspect; end
4052
+ def organisation; end
4053
+
4054
+ # Returns the value of attribute scm.
4055
+ def scm; end
4056
+
4057
+ # Sets the attribute scm
4058
+ #
4059
+ # @param value the value to set the attribute scm to.
4060
+ def scm=(_arg0); end
4061
+
4062
+ def setup_danger_branches; end
4063
+ def update_build_status(status); end
4064
+ def update_pull_request!(_warnings: T.unsafe(nil), _errors: T.unsafe(nil), _messages: T.unsafe(nil), _markdowns: T.unsafe(nil)); end
4065
+
4066
+ # @return [Boolean]
4067
+ def validates_as_api_source?; end
4068
+
4069
+ # @return [Boolean] whether scm.origins is a valid git repository or not
4070
+ def validates_as_ci?; end
4071
+
4072
+ class << self
4073
+ def available_request_sources; end
4074
+ def available_source_names_and_envs; end
4075
+ def env_vars; end
4076
+
4077
+ # @private
4078
+ def inherited(child_class); end
4079
+
4080
+ def optional_env_vars; end
4081
+ def source_name; end
4082
+ end
4083
+ end
4084
+
4085
+ Danger::RequestSources::RequestSource::DANGER_REPO_NAME = T.let(T.unsafe(nil), String)
4086
+
4087
+ class Danger::RequestSources::VSTS < ::Danger::RequestSources::RequestSource
4088
+ include ::Danger::Helpers::CommentsParsingHelper
4089
+ include ::Danger::Helpers::CommentsHelper
4090
+
4091
+ # @return [VSTS] a new instance of VSTS
4092
+ def initialize(ci_source, environment); end
4093
+
4094
+ def client; end
4095
+ def fetch_details; end
4096
+ def host; end
4097
+ def messages_are_equivalent(m1, m2); end
4098
+ def organisation; end
4099
+ def post_new_comment(comment); end
4100
+
4101
+ # Returns the value of attribute pr_json.
4102
+ def pr_json; end
4103
+
4104
+ # Sets the attribute pr_json
4105
+ #
4106
+ # @param value the value to set the attribute pr_json to.
4107
+ def pr_json=(_arg0); end
4108
+
4109
+ def scm; end
4110
+ def setup_danger_branches; end
4111
+ def submit_inline_comments!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), previous_violations: T.unsafe(nil), danger_id: T.unsafe(nil)); end
4112
+ def submit_inline_comments_for_kind!(kind, messages, danger_threads, previous_violations, danger_id: T.unsafe(nil)); end
4113
+ def update_old_comment(new_comment, danger_id: T.unsafe(nil)); end
4114
+ def update_pull_request!(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil), danger_id: T.unsafe(nil), new_comment: T.unsafe(nil), remove_previous_comments: T.unsafe(nil)); end
4115
+
4116
+ # @return [Boolean]
4117
+ def validates_as_api_source?; end
4118
+
4119
+ # @return [Boolean]
4120
+ def validates_as_ci?; end
4121
+
4122
+ private
4123
+
4124
+ def inline_violations_group(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil)); end
4125
+ def merge_violations(*violation_groups); end
4126
+ def regular_violations_group(warnings: T.unsafe(nil), errors: T.unsafe(nil), messages: T.unsafe(nil), markdowns: T.unsafe(nil)); end
4127
+
4128
+ class << self
4129
+ def env_vars; end
4130
+ def optional_env_vars; end
4131
+ end
4132
+ end
4133
+
4134
+ class Danger::RequestSources::VSTSAPI
4135
+ # @return [VSTSAPI] a new instance of VSTSAPI
4136
+ def initialize(_project, slug, pull_request_id, environment); end
4137
+
4138
+ # @return [Boolean]
4139
+ def credentials_given?; end
4140
+
4141
+ def fetch_last_comments; end
4142
+ def fetch_pr_json; end
4143
+
4144
+ # Returns the value of attribute host.
4145
+ def host; end
4146
+
4147
+ # Sets the attribute host
4148
+ #
4149
+ # @param value the value to set the attribute host to.
4150
+ def host=(_arg0); end
4151
+
4152
+ def inspect; end
4153
+
4154
+ # Returns the value of attribute min_api_version_for_comments.
4155
+ def min_api_version_for_comments; end
4156
+
4157
+ # Sets the attribute min_api_version_for_comments
4158
+ #
4159
+ # @param value the value to set the attribute min_api_version_for_comments to.
4160
+ def min_api_version_for_comments=(_arg0); end
4161
+
4162
+ def post_comment(text); end
4163
+ def post_inline_comment(text, file, line); end
4164
+
4165
+ # Returns the value of attribute pr_api_endpoint.
4166
+ def pr_api_endpoint; end
4167
+
4168
+ # Sets the attribute pr_api_endpoint
4169
+ #
4170
+ # @param value the value to set the attribute pr_api_endpoint to.
4171
+ def pr_api_endpoint=(_arg0); end
4172
+
4173
+ # @return [Boolean]
4174
+ def supports_comments?; end
4175
+
4176
+ def update_comment(thread, id, new_comment); end
4177
+
4178
+ private
4179
+
4180
+ def fetch_json(uri); end
4181
+ def patch(uri, body); end
4182
+ def post(uri, body); end
4183
+ def use_ssl; end
4184
+ end
4185
+
4186
+ class Danger::Runner < ::CLAide::Command
4187
+ # @return [Runner] a new instance of Runner
4188
+ def initialize(argv); end
4189
+
4190
+ # Returns the value of attribute cork.
4191
+ def cork; end
4192
+
4193
+ # Sets the attribute cork
4194
+ #
4195
+ # @param value the value to set the attribute cork to.
4196
+ def cork=(_arg0); end
4197
+
4198
+ def run; end
4199
+ def validate!; end
4200
+
4201
+ private
4202
+
4203
+ def adjust_colored2_output(argv); end
4204
+
4205
+ class << self
4206
+ def options; end
4207
+ end
4208
+ end
4209
+
4210
+ # ### CI Setup
4211
+ #
4212
+ # Install dependencies and add a danger step to your screwdriver.yaml:
4213
+ #
4214
+ # ```yml
4215
+ # jobs:
4216
+ # danger:
4217
+ # requires: [~pr, ~commit]
4218
+ # steps:
4219
+ # - setup: bundle install --path vendor
4220
+ # - danger: bundle exec danger
4221
+ # secrets:
4222
+ # - DANGER_GITHUB_API_TOKEN
4223
+ # ```
4224
+ #
4225
+ # ### Token Setup
4226
+ #
4227
+ # Add the `DANGER_GITHUB_API_TOKEN` to your pipeline env as a
4228
+ # [build secret](https://docs.screwdriver.cd/user-guide/configuration/secrets)
4229
+ class Danger::Screwdriver < ::Danger::CI
4230
+ # @return [Screwdriver] a new instance of Screwdriver
4231
+ def initialize(env); end
4232
+
4233
+ def supported_request_sources; end
4234
+
4235
+ class << self
4236
+ # @return [Boolean]
4237
+ def validates_as_ci?(env); end
4238
+
4239
+ # @return [Boolean]
4240
+ def validates_as_pr?(env); end
4241
+ end
4242
+ end
4243
+
4244
+ # ### CI Setup
4245
+ #
4246
+ # For Semaphore you will want to go to the settings page of the project. Inside "Build Settings"
4247
+ # you should add `bundle exec danger` to the Setup thread. Note that Semaphore only provides
4248
+ # the build environment variables necessary for Danger on PRs across forks.
4249
+ #
4250
+ # ### Token Setup
4251
+ #
4252
+ # You can add your `DANGER_GITHUB_API_TOKEN` inside the "Environment Variables" section in the settings.
4253
+ class Danger::Semaphore < ::Danger::CI
4254
+ # @return [Semaphore] a new instance of Semaphore
4255
+ def initialize(env); end
4256
+
4257
+ def supported_request_sources; end
4258
+
4259
+ class << self
4260
+ # @return [Boolean]
4261
+ def validates_as_ci?(env); end
4262
+
4263
+ # @return [Boolean]
4264
+ def validates_as_pr?(env); end
4265
+ end
4266
+ end
4267
+
4268
+ class Danger::Staging < ::Danger::Runner
4269
+ # @return [Staging] a new instance of Staging
4270
+ def initialize(argv); end
4271
+
4272
+ def run; end
4273
+ def validate!; end
4274
+
4275
+ class << self
4276
+ def options; end
4277
+ end
4278
+ end
4279
+
4280
+ # ### CI Setup
4281
+ #
4282
+ # You want to add `bundle exec danger` to your `build.sh` file to run Danger at the
4283
+ # end of your build.
4284
+ #
4285
+ # ### Token Setup
4286
+ #
4287
+ # As this is self-hosted, you will need to add the `DANGER_GITHUB_API_TOKEN` to your build user's ENV. The alternative
4288
+ # is to pass in the token as a prefix to the command `DANGER_GITHUB_API_TOKEN="123" bundle exec danger`.
4289
+ class Danger::Surf < ::Danger::CI
4290
+ # @return [Surf] a new instance of Surf
4291
+ def initialize(env); end
4292
+
4293
+ def supported_request_sources; end
4294
+
4295
+ class << self
4296
+ # @return [Boolean]
4297
+ def validates_as_ci?(env); end
4298
+
4299
+ # @return [Boolean]
4300
+ def validates_as_pr?(env); end
4301
+ end
4302
+ end
4303
+
4304
+ class Danger::Systems < ::Danger::Runner; end
4305
+
4306
+ # ### CI Setup
4307
+ #
4308
+ # You need to go to your project settings. Then depending on the type of your build settings, you may need
4309
+ # to add a new build step for Danger. You want to be able to run the command `bundle exec danger`, so
4310
+ # the "Simple Command Runner" should be all you need to do that.
4311
+ #
4312
+ # ### Token + Environment Setup
4313
+ #
4314
+ # #### GitHub
4315
+ #
4316
+ # As this is self-hosted, you will need to add the `DANGER_GITHUB_API_TOKEN` to your build user's ENV. The alternative
4317
+ # is to pass in the token as a prefix to the command `DANGER_GITHUB_API_TOKEN="123" bundle exec danger`.
4318
+ #
4319
+ # However, you will need to find a way to add the environment vars: `GITHUB_REPO_SLUG`, `GITHUB_PULL_REQUEST_ID` and
4320
+ # `GITHUB_REPO_URL`. These are not added by default. You can manually add `GITHUB_REPO_SLUG` and `GITHUB_REPO_URL`
4321
+ # as build parameters or by exporting them inside your Simple Command Runner.
4322
+ #
4323
+ # As for `GITHUB_PULL_REQUEST_ID`, TeamCity provides the `%teamcity.build.branch%` variable which is in the format
4324
+ # `PR_NUMBER/merge`. You can slice the Pull Request ID out by doing the following:
4325
+ #
4326
+ # ```sh
4327
+ # branch="%teamcity.build.branch%"
4328
+ # export GITHUB_PULL_REQUEST_ID=(${branch//\// })
4329
+ # ```
4330
+ #
4331
+ # Or if you are using the pull request feature you can set an environment parameter called `GITHUB_PULL_REQUEST_ID`
4332
+ # to the value of: `%teamcity.pullRequest.number`
4333
+ #
4334
+ # #### GitLab
4335
+ #
4336
+ # As this is self-hosted, you will need to add the `DANGER_GITLAB_API_TOKEN` to your build user's ENV. The alternative
4337
+ # is to pass in the token as a prefix to the command `DANGER_GITLAB_API_TOKEN="123" bundle exec danger`.
4338
+ #
4339
+ # However, you will need to find a way to add the environment vars: `GITLAB_REPO_SLUG`, `GITLAB_PULL_REQUEST_ID` and
4340
+ # `GITLAB_REPO_URL`. These are not added by default. You could do this via the GitLab API potentially.
4341
+ #
4342
+ # We would love some advice on improving this setup.
4343
+ #
4344
+ # #### BitBucket Cloud
4345
+ #
4346
+ # You will need to add the following environment variables as build parameters or by exporting them inside your
4347
+ # Simple Command Runner.
4348
+ #
4349
+ #
4350
+ # - `BITBUCKET_REPO_SLUG`
4351
+ # - `BITBUCKET_REPO_URL`
4352
+ #
4353
+ # - `DANGER_BITBUCKETCLOUD_USERNAME`
4354
+ # - `DANGER_BITBUCKETCLOUD_PASSWORD`
4355
+ #
4356
+ # or
4357
+ #
4358
+ # - `DANGER_BITBUCKETCLOUD_OAUTH_KEY`
4359
+ # - `DANGER_BITBUCKETCLOUD_OAUTH_SECRET`
4360
+ #
4361
+ # You will also need to set the `BITBUCKET_BRANCH_NAME` environment variable.
4362
+ # TeamCity provides `%teamcity.build.branch%`, which you can use at the top of your Simple Command Runner:
4363
+ #
4364
+ # ```sh
4365
+ # export BITBUCKET_BRANCH_NAME="%teamcity.build.branch%"
4366
+ # ```
4367
+ #
4368
+ # #### BitBucket Server
4369
+ #
4370
+ # You will need to add the following environment variables as build parameters or by exporting them inside your
4371
+ # Simple Command Runner.
4372
+ #
4373
+ # - `DANGER_BITBUCKETSERVER_USERNAME`
4374
+ # - `DANGER_BITBUCKETSERVER_PASSWORD`
4375
+ # - `DANGER_BITBUCKETSERVER_HOST`
4376
+ # - `BITBUCKETSERVER_REPO_SLUG`
4377
+ # - `BITBUCKETSERVER_PULL_REQUEST_ID`
4378
+ # - `BITBUCKETSERVER_REPO_URL`
4379
+ class Danger::TeamCity < ::Danger::CI
4380
+ # @return [TeamCity] a new instance of TeamCity
4381
+ def initialize(env); end
4382
+
4383
+ def supported_request_sources; end
4384
+
4385
+ private
4386
+
4387
+ # This is a little hacky, because Bitbucket doesn't provide us a PR id
4388
+ def bitbucket_pr_from_env(env); end
4389
+
4390
+ def extract_bitbucket_server_variables!(env); end
4391
+ def extract_bitbucket_variables!(env); end
4392
+ def extract_github_variables!(env); end
4393
+ def extract_gitlab_variables!(env); end
4394
+
4395
+ class << self
4396
+ # @return [Boolean]
4397
+ def validates_as_bitbucket_cloud_pr?(env); end
4398
+
4399
+ # @return [Boolean]
4400
+ def validates_as_bitbucket_server_pr?(env); end
4401
+
4402
+ # @return [Boolean]
4403
+ def validates_as_ci?(env); end
4404
+
4405
+ # @return [Boolean]
4406
+ def validates_as_github_pr?(env); end
4407
+
4408
+ # @return [Boolean]
4409
+ def validates_as_gitlab_pr?(env); end
4410
+
4411
+ # @return [Boolean]
4412
+ def validates_as_pr?(env); end
4413
+ end
4414
+ end
4415
+
4416
+ # ### CI Setup
4417
+ # You need to edit your `.travis.yml` to include `bundle exec danger`. If you already have
4418
+ # a `script:` section then we recommend adding this command at the end of the script step: `- bundle exec danger`.
4419
+ #
4420
+ # Otherwise, add a `before_script` step to the root of the `.travis.yml` with `bundle exec danger`
4421
+ #
4422
+ # ```ruby
4423
+ # before_script:
4424
+ # - bundle exec danger
4425
+ # ```
4426
+ #
4427
+ # Adding this to your `.travis.yml` allows Danger to fail your build, both on the TravisCI website and within your Pull Request.
4428
+ # With that set up, you can edit your job to add `bundle exec danger` at the build action.
4429
+ #
4430
+ # _Note:_ Travis CI defaults to using an older version of Ruby, so you may need to add `rvm: 2.0.0` to the root your `.travis.yml`.
4431
+ #
4432
+ # ### Token Setup
4433
+ #
4434
+ # You need to add the `DANGER_GITHUB_API_TOKEN` environment variable, to do this,
4435
+ # go to your repo's settings, which should look like: `https://travis-ci.org/[user]/[repo]/settings`.
4436
+ #
4437
+ # If you have an open source project, you should ensure "Display value in build log" enabled, so that PRs from forks work.
4438
+ class Danger::Travis < ::Danger::CI
4439
+ # @return [Travis] a new instance of Travis
4440
+ def initialize(env); end
4441
+
4442
+ def supported_request_sources; end
4443
+
4444
+ class << self
4445
+ # @return [Boolean]
4446
+ def validates_as_ci?(env); end
4447
+
4448
+ # @return [Boolean]
4449
+ def validates_as_pr?(env); end
4450
+ end
4451
+ end
4452
+
4453
+ Danger::VERSION = T.let(T.unsafe(nil), String)
4454
+
4455
+ # ### CI Setup
4456
+ #
4457
+ # You need to go to your project's build definition. Then add a "Command Line" Task with the "Tool" field set to "bundle"
4458
+ # and the "Arguments" field set to "exec danger".
4459
+ #
4460
+ # ### Token Setup
4461
+ #
4462
+ # #### GitHub
4463
+ #
4464
+ # You need to add the `DANGER_GITHUB_API_TOKEN` environment variable, to do this, go to your build definition's variables tab.
4465
+ #
4466
+ # Make sure that `DANGER_GITHUB_API_TOKEN` is not set to secret since vsts does not expose secret variables while building.
4467
+ #
4468
+ # #### VSTS
4469
+ #
4470
+ # You need to add the `DANGER_VSTS_API_TOKEN` and `DANGER_VSTS_HOST` environment variable, to do this,
4471
+ # go to your build definition's variables tab. The `DANGER_VSTS_API_TOKEN` is your vsts personal access token.
4472
+ # Instructions for creating a personal access token can be found [here](https://www.visualstudio.com/en-us/docs/setup-admin/team-services/use-personal-access-tokens-to-authenticate).
4473
+ # For the `DANGER_VSTS_HOST` variable the suggested value is `$(System.TeamFoundationCollectionUri)$(System.TeamProject)`
4474
+ # which will automatically get your vsts domain and your project name needed for the vsts api.
4475
+ #
4476
+ # Make sure that `DANGER_VSTS_API_TOKEN` is not set to secret since vsts does not expose secret variables while building.
4477
+ class Danger::VSTS < ::Danger::CI
4478
+ # @return [VSTS] a new instance of VSTS
4479
+ def initialize(env); end
4480
+
4481
+ def supported_request_sources; end
4482
+
4483
+ class << self
4484
+ def github_slug(env); end
4485
+
4486
+ # @return [Boolean]
4487
+ def validates_as_ci?(env); end
4488
+
4489
+ # @return [Boolean]
4490
+ def validates_as_pr?(env); end
4491
+
4492
+ def vsts_slug(env); end
4493
+ end
4494
+ end
4495
+
4496
+ class Danger::Violation < ::Danger::BaseMessage
4497
+ # @raise [ArgumentError]
4498
+ # @return [Violation] a new instance of Violation
4499
+ def initialize(message, sticky, file = T.unsafe(nil), line = T.unsafe(nil), type: T.unsafe(nil)); end
4500
+
4501
+ def <=>(other); end
4502
+ def ==(other); end
4503
+ def hash; end
4504
+
4505
+ # Returns the value of attribute sticky.
4506
+ def sticky; end
4507
+
4508
+ # Sets the attribute sticky
4509
+ #
4510
+ # @param value the value to set the attribute sticky to.
4511
+ def sticky=(_arg0); end
4512
+
4513
+ def to_s; end
4514
+ end
4515
+
4516
+ Danger::Violation::VALID_TYPES = T.let(T.unsafe(nil), Array)
4517
+
4518
+ # ### CI Setup
4519
+ #
4520
+ # In order to work with Xcode Cloud and Danger, you will need to add `bundle exec danger` to
4521
+ # the `ci_scripts/ci_post_xcodebuild.sh` (Xcode Cloud's expected filename for a post-action build script).
4522
+ # More details and documentation on Xcode Cloud configuration can be found [here](https://developer.apple.com/documentation/xcode/writing-custom-build-scripts).
4523
+ #
4524
+ # ### Token Setup
4525
+ #
4526
+ # You will need to add the `DANGER_GITHUB_API_TOKEN` to your build environment.
4527
+ # If running on GitHub Enterprise, make sure you also set the expected values for
4528
+ # both `DANGER_GITHUB_API_HOST` and `DANGER_GITHUB_HOST`.
4529
+ class Danger::XcodeCloud < ::Danger::CI
4530
+ # @return [XcodeCloud] a new instance of XcodeCloud
4531
+ def initialize(env); end
4532
+
4533
+ def supported_request_sources; end
4534
+
4535
+ class << self
4536
+ # @return [Boolean]
4537
+ def validates_as_ci?(env); end
4538
+
4539
+ # @return [Boolean]
4540
+ def validates_as_pr?(env); end
4541
+ end
4542
+ end
4543
+
4544
+ # ### CI Setup
4545
+ #
4546
+ # If you're bold enough to use Xcode Bots. You will need to use [Buildasaur](https://github.com/czechboy0/Buildasaur)
4547
+ # in order to work with Danger. This will set up your build environment for you, as the name of the bot contains all
4548
+ # of the environment variables that Danger needs to work.
4549
+ #
4550
+ # With Buildasaur set up, you can edit your job to add `bundle exec danger` as a post-action build script.
4551
+ #
4552
+ # ### Token Setup
4553
+ #
4554
+ # As this is self-hosted, you will need to add the `DANGER_GITHUB_API_TOKEN` to your build user's ENV. The alternative
4555
+ # is to pass in the token as a prefix to the command `DANGER_GITHUB_API_TOKEN="123" bundle exec danger`.`.
4556
+ class Danger::XcodeServer < ::Danger::CI
4557
+ # @return [XcodeServer] a new instance of XcodeServer
4558
+ def initialize(env); end
4559
+
4560
+ def supported_request_sources; end
4561
+
4562
+ class << self
4563
+ # @return [Boolean]
4564
+ def validates_as_ci?(env); end
4565
+
4566
+ # @return [Boolean]
4567
+ def validates_as_pr?(env); end
4568
+ end
4569
+ end
4570
+
4571
+ # Find max_num_violations in lib/danger/comment_generators/github.md.erb.
4572
+ class FindMaxNumViolations
4573
+ # @return [FindMaxNumViolations] a new instance of FindMaxNumViolations
4574
+ def initialize(violations); end
4575
+
4576
+ def call; end
4577
+
4578
+ private
4579
+
4580
+ # Returns the value of attribute violations.
4581
+ def violations; end
4582
+ end
4583
+
4584
+ # Save ~ 5000 for contents other than violations to avoid exceeded 65536 max comment length limit.
4585
+ FindMaxNumViolations::LIMIT = T.let(T.unsafe(nil), Integer)
4586
+
4587
+ class GetIgnoredViolation
4588
+ # @return [GetIgnoredViolation] a new instance of GetIgnoredViolation
4589
+ def initialize(body); end
4590
+
4591
+ def call; end
4592
+
4593
+ private
4594
+
4595
+ # Returns the value of attribute body.
4596
+ def body; end
4597
+ end
4598
+
4599
+ GetIgnoredViolation::IGNORE_REGEXP = T.let(T.unsafe(nil), Regexp)
4600
+
4601
+ module Git
4602
+ def config(name = T.unsafe(nil), value = T.unsafe(nil)); end
4603
+ def global_config(name = T.unsafe(nil), value = T.unsafe(nil)); end
4604
+
4605
+ class << self
4606
+ def bare(git_dir, options = T.unsafe(nil)); end
4607
+ def clone(repository_url, directory = T.unsafe(nil), options = T.unsafe(nil)); end
4608
+ def config; end
4609
+ def configure; end
4610
+ def export(repository, name, options = T.unsafe(nil)); end
4611
+ def global_config(name = T.unsafe(nil), value = T.unsafe(nil)); end
4612
+ def init(directory = T.unsafe(nil), options = T.unsafe(nil)); end
4613
+ def ls_remote(location = T.unsafe(nil), options = T.unsafe(nil)); end
4614
+ def open(working_dir, options = T.unsafe(nil)); end
4615
+ end
4616
+ end
4617
+
4618
+ class Git::Base
4619
+ include ::Git::Base::Factory
4620
+
4621
+ def initialize(options = T.unsafe(nil)); end
4622
+
4623
+ def add(paths = T.unsafe(nil), **options); end
4624
+ def add_remote(name, url, opts = T.unsafe(nil)); end
4625
+ def add_tag(name, *options); end
4626
+ def apply(file); end
4627
+ def apply_mail(file); end
4628
+ def archive(treeish, file = T.unsafe(nil), opts = T.unsafe(nil)); end
4629
+ def cat_file(objectish); end
4630
+ def chdir; end
4631
+ def checkout(branch = T.unsafe(nil), opts = T.unsafe(nil)); end
4632
+ def checkout_file(version, file); end
4633
+ def checkout_index(opts = T.unsafe(nil)); end
4634
+ def clean(opts = T.unsafe(nil)); end
4635
+ def commit(message, opts = T.unsafe(nil)); end
4636
+ def commit_all(message, opts = T.unsafe(nil)); end
4637
+ def config(name = T.unsafe(nil), value = T.unsafe(nil), options = T.unsafe(nil)); end
4638
+ def current_branch; end
4639
+ def delete_tag(name); end
4640
+ def describe(committish = T.unsafe(nil), opts = T.unsafe(nil)); end
4641
+ def dir; end
4642
+ def each_conflict(&block); end
4643
+ def fetch(remote = T.unsafe(nil), opts = T.unsafe(nil)); end
4644
+ def gc; end
4645
+ def grep(string, path_limiter = T.unsafe(nil), opts = T.unsafe(nil)); end
4646
+ def index; end
4647
+ def is_branch?(branch); end
4648
+ def is_local_branch?(branch); end
4649
+ def is_remote_branch?(branch); end
4650
+ def lib; end
4651
+ def ls_files(location = T.unsafe(nil)); end
4652
+ def ls_tree(objectish); end
4653
+ def merge(branch, message = T.unsafe(nil), opts = T.unsafe(nil)); end
4654
+
4655
+ # Use git-merge-base https://git-scm.com/docs/git-merge-base to
4656
+ # find as good common ancestors as possible for a merge
4657
+ def merge_base(commit1, commit2, *other_commits); end
4658
+
4659
+ def pull(remote = T.unsafe(nil), branch = T.unsafe(nil)); end
4660
+ def push(remote = T.unsafe(nil), branch = T.unsafe(nil), opts = T.unsafe(nil)); end
4661
+ def read_tree(treeish, opts = T.unsafe(nil)); end
4662
+ def remotes; end
4663
+ def remove(path = T.unsafe(nil), opts = T.unsafe(nil)); end
4664
+ def remove_remote(name); end
4665
+ def repack; end
4666
+ def repo; end
4667
+ def repo_size; end
4668
+ def reset(commitish = T.unsafe(nil), opts = T.unsafe(nil)); end
4669
+ def reset_hard(commitish = T.unsafe(nil), opts = T.unsafe(nil)); end
4670
+ def revert(commitish = T.unsafe(nil), opts = T.unsafe(nil)); end
4671
+ def revparse(objectish); end
4672
+ def set_index(index_file, check = T.unsafe(nil)); end
4673
+ def set_remote_url(name, url); end
4674
+ def set_working(work_dir, check = T.unsafe(nil)); end
4675
+ def show(objectish = T.unsafe(nil), path = T.unsafe(nil)); end
4676
+ def tags; end
4677
+ def update_ref(branch, commit); end
4678
+ def with_index(new_index); end
4679
+ def with_temp_index(&blk); end
4680
+ def with_temp_working(&blk); end
4681
+ def with_working(work_dir); end
4682
+ def write_and_commit_tree(opts = T.unsafe(nil)); end
4683
+ def write_tree; end
4684
+
4685
+ class << self
4686
+ def bare(git_dir, options = T.unsafe(nil)); end
4687
+ def clone(repository_url, directory, options = T.unsafe(nil)); end
4688
+ def config; end
4689
+ def init(directory = T.unsafe(nil), options = T.unsafe(nil)); end
4690
+ def open(working_dir, options = T.unsafe(nil)); end
4691
+
4692
+ private
4693
+
4694
+ def normalize_index(options); end
4695
+ def normalize_paths(options, default_working_directory: T.unsafe(nil), default_repository: T.unsafe(nil), bare: T.unsafe(nil)); end
4696
+ def normalize_repository(options, default:, bare: T.unsafe(nil)); end
4697
+ def normalize_working_directory(options, default:, bare: T.unsafe(nil)); end
4698
+ end
4699
+ end
4700
+
4701
+ Git::VERSION = T.let(T.unsafe(nil), String)
4702
+
4703
+ # Enhance the String class with a XML escaped character version of
4704
+ # to_s.
4705
+ class String
4706
+ include ::Comparable
4707
+ include ::JSON::Ext::Generator::GeneratorMethods::String
4708
+ include ::Colored2
4709
+ extend ::JSON::Ext::Generator::GeneratorMethods::String::Extend
4710
+
4711
+ # @return [String] the plural form of self determined by count
4712
+ def danger_pluralize(count); end
4713
+
4714
+ # @return [String] truncates string with ellipsis when exceeding the limit
4715
+ def danger_truncate(limit); end
4716
+
4717
+ # @return [String] converts to underscored, lowercase form
4718
+ def danger_underscore; end
4719
+ end
4720
+
4721
+ String::BLANK_RE = T.let(T.unsafe(nil), Regexp)
4722
+ String::ENCODED_BLANKS = T.let(T.unsafe(nil), Concurrent::Map)