danger 9.3.1 → 9.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 719588ed490c1115e2439aabacb0dd400e1852bf03a0f25514b26dcb08e0ad9e
4
- data.tar.gz: 7426ab63483923ceffd843789c473a46f7726b1f9057a74b558bbeeb2c6948d9
3
+ metadata.gz: 7310f8ce0107be43eb12fbf841273878fb0fd4c8e8a0f623689506a930c354cc
4
+ data.tar.gz: 1b187cc8027ed57b2f204f3e8222f4373baf40c63e94a35bdcc22079dfbc1d47
5
5
  SHA512:
6
- metadata.gz: 9fa39fb8d2a11ac973a1c4b7a9647bef1a0bfdd36411d403e1f3121b3a1b7490dbaa7489c17f018fa1ae88be4ceccc6ee213267ee32133dfbf162cb3bab93e6f
7
- data.tar.gz: 01ba1c81cfdb4a37661826f913ed3227e1432fbbede1d69e6521eacfd4d6c8595f8a5140134c431446b591f81027797a4f93b67b674fcfd9c860d452575ea5fb
6
+ metadata.gz: dd4d4a9b2810edde68fb71823868c3566fd3f12141876f46d7b2b91c381901c328550e3f3521fcbcfd4faa27f16a435dc4f81e09e30708aef5e6ce103ef5dc32
7
+ data.tar.gz: b19572d95dfdc38061db32f12a77cdc4f7e21c5447f75214a489467140a3d3caee4e1ac3501a5a87aba5b1037614d20b5aa50a33ee0248b1480d489d2b7d3e6b
data/README.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  [![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/orta/danger/blob/master/LICENSE)
4
4
  [![Gem](https://img.shields.io/gem/v/danger.svg?style=flat)](http://rubygems.org/gems/danger)
5
- [![Travis CI](https://img.shields.io/travis/danger/danger.svg?style=flat)](https://travis-ci.org/danger/danger)
6
- [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/danger)
5
+ [![CI](https://github.com/danger/danger/actions/workflows/CI.yml/badge.svg)](https://github.com/danger/danger/actions/workflows/CI.yml)
7
6
 
8
7
  Formalize your Pull Request etiquette.
9
8
 
@@ -29,8 +29,6 @@ module Danger
29
29
  # which will automatically get your vsts domain and your project name needed for the vsts api.
30
30
  #
31
31
  class AzurePipelines < CI
32
-
33
-
34
32
  def self.validates_as_ci?(env)
35
33
  has_all_variables = ["AGENT_ID", "BUILD_SOURCEBRANCH", "BUILD_REPOSITORY_URI", "BUILD_REASON", "BUILD_REPOSITORY_NAME"].all? { |x| env[x] && !env[x].empty? }
36
34
 
@@ -31,7 +31,7 @@ module Danger
31
31
  end
32
32
 
33
33
  def initialize(_env)
34
- raise "Subclass and overwrite initialize"
34
+ raise "Subclass and overwrite initialize" if method(__method__).owner == Danger::CI
35
35
  end
36
36
  end
37
37
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "danger/request_sources/github/github"
2
4
 
3
5
  module Danger
@@ -31,6 +33,8 @@ module Danger
31
33
  end
32
34
 
33
35
  def initialize(env)
36
+ super
37
+
34
38
  self.repo_slug = env["GITHUB_REPOSITORY"]
35
39
  pull_request_event = JSON.parse(File.read(env["GITHUB_EVENT_PATH"]))
36
40
  self.pull_request_id = pull_request_event["number"]
@@ -146,7 +146,7 @@ module Danger
146
146
  require "danger/request_sources/bitbucket_server_api"
147
147
  project, slug = repo_slug.split("/")
148
148
  RequestSources::BitbucketServerAPI.new(project, slug, specific_pull_request_id, env)
149
-
149
+
150
150
  when :vsts
151
151
  require "danger/request_sources/vsts_api"
152
152
  RequestSources::VSTSAPI.new(repo_slug, specific_pull_request_id, env)
@@ -181,7 +181,7 @@ module Danger
181
181
  elsif remote_url =~ %r{/pull-requests/}
182
182
  :bitbucket_server
183
183
  elsif remote_url =~ /\.visualstudio\.com/i || remote_url =~ /dev\.azure\.com/i
184
- :vsts
184
+ :vsts
185
185
  else
186
186
  :github
187
187
  end
@@ -70,18 +70,14 @@ module Danger
70
70
  def update_pull_request!(warnings: [], errors: [], messages: [], markdowns: [], danger_id: "danger", new_comment: false, remove_previous_comments: false)
71
71
  delete_old_comments(danger_id: danger_id) if !new_comment || remove_previous_comments
72
72
 
73
- comment = generate_description(warnings: warnings, errors: errors, template: "bitbucket_server")
74
- comment += "\n\n"
75
-
76
73
  warnings = update_inline_comments_for_kind!(:warnings, warnings, danger_id: danger_id)
77
74
  errors = update_inline_comments_for_kind!(:errors, errors, danger_id: danger_id)
78
75
  messages = update_inline_comments_for_kind!(:messages, messages, danger_id: danger_id)
79
76
  markdowns = update_inline_comments_for_kind!(:markdowns, markdowns, danger_id: danger_id)
80
77
 
81
- has_comments = (warnings.count > 0 || errors.count > 0 || messages.count > 0 || markdowns.count > 0)
78
+ has_comments = (warnings.count.positive? || errors.count.positive? || messages.count.positive? || markdowns.count.positive?)
82
79
  if has_comments
83
- comment = generate_description(warnings: warnings,
84
- errors: errors)
80
+ comment = generate_description(warnings: warnings, errors: errors, template: "bitbucket_server")
85
81
  comment += "\n\n"
86
82
  comment += generate_comment(warnings: warnings,
87
83
  errors: errors,
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "9.3.1".freeze
2
+ VERSION = "9.3.2".freeze
3
3
  DESCRIPTION = "Like Unit Tests, but for your Team Culture.".freeze
4
4
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.3.1
4
+ version: 9.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
8
8
  - Juanito Fatas
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-06-06 00:00:00.000000000 Z
12
+ date: 2023-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide
@@ -329,7 +329,7 @@ homepage: https://github.com/danger/danger
329
329
  licenses:
330
330
  - MIT
331
331
  metadata: {}
332
- post_install_message:
332
+ post_install_message:
333
333
  rdoc_options: []
334
334
  require_paths:
335
335
  - lib
@@ -344,8 +344,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
344
  - !ruby/object:Gem::Version
345
345
  version: '0'
346
346
  requirements: []
347
- rubygems_version: 3.1.6
348
- signing_key:
347
+ rubygems_version: 3.3.26
348
+ signing_key:
349
349
  specification_version: 4
350
350
  summary: Like Unit Tests, but for your Team Culture.
351
351
  test_files: []