danger 5.16.0 → 5.16.1

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
- SHA256:
3
- metadata.gz: 3b40ff7a6e2e8ad3341d4e706e8d185a8c4287016e8ae5ed92e1b5609f9a4bf7
4
- data.tar.gz: 152b14f3da15104d3e57dc1ade876c21a1558faea572d779760f65818340fb3f
2
+ SHA1:
3
+ metadata.gz: 133d839f0f6c3eedc50601b624f25f793f9fa29e
4
+ data.tar.gz: d946b6c8c735b6953da0aa10c25f1d79e973a37c
5
5
  SHA512:
6
- metadata.gz: c65cc6fa247104fe197ba532d02b7130558e1b3ee014818ca50cb03c31625b07c938d9a4b0fe909bfa136a7feb705c0c23f348e8713cd1d96cab058f6297a70a
7
- data.tar.gz: 31da304ece4f45a98fe54ea148998750c5f7a4f3a0dec9dd57e2f0b3b907586695d740a32dd423e642c227e9fd33d1f2ce4d10093830a4184d75cb0569354b18
6
+ metadata.gz: 87d8c1b18b032a8cbba94c2ab7286014c2a302d3ea23f7fc54cb6e7d731c8908c9a4851703a8b574609b5f12e151cbce27d84c208929afdd0ca7c5203a9a12a7
7
+ data.tar.gz: 4be777c012951b447e52f431c6ec9537159011c584a2f52928ec6543ca747a8a7f583bcde36941838380b5e4efc34fb9b152c9c3ab339f602008ceeeddf3632f
@@ -90,11 +90,26 @@ module Danger
90
90
 
91
91
  def mr_diff
92
92
  @mr_diff ||= begin
93
- client.merge_request_changes(ci_source.repo_slug, ci_source.pull_request_id)
93
+ mr_changes
94
94
  .changes.map { |change| change["diff"] }.join("\n")
95
95
  end
96
96
  end
97
97
 
98
+ def mr_changed_paths
99
+ @mr_changed_paths ||= begin
100
+ mr_changes
101
+ .changes.map { |change| change["new_path"] }
102
+ end
103
+
104
+ @mr_changed_paths
105
+ end
106
+
107
+ def mr_changes
108
+ @mr_changes ||= begin
109
+ client.merge_request_changes(ci_source.repo_slug, ci_source.pull_request_id)
110
+ end
111
+ end
112
+
98
113
  def setup_danger_branches
99
114
  base_branch = self.mr_json.source_branch
100
115
  head_branch = self.mr_json.target_branch
@@ -359,10 +374,8 @@ module Danger
359
374
  messages.reject do |m|
360
375
  next false unless m.file && m.line
361
376
 
362
- # position = find_position_in_diff diff_lines, m, kind
363
-
364
- # Keep the change if it's line is not in the diff and not in dismiss mode
365
- # next dismiss_out_of_range_messages_for(kind) if position.nil?
377
+ # Keep the change it's in a file changed in this diff
378
+ next if !mr_changed_paths.include?(m.file)
366
379
 
367
380
  # Once we know we're gonna submit it, we format it
368
381
  if is_markdown_content
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "5.16.0".freeze
2
+ VERSION = "5.16.1".freeze
3
3
  DESCRIPTION = "Like Unit Tests, but for your Team Culture.".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.16.0
4
+ version: 5.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-27 00:00:00.000000000 Z
12
+ date: 2019-02-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  version: '0'
303
303
  requirements: []
304
304
  rubyforge_project:
305
- rubygems_version: 2.7.6
305
+ rubygems_version: 2.5.2.3
306
306
  signing_key:
307
307
  specification_version: 4
308
308
  summary: Like Unit Tests, but for your Team Culture.