danger-packwerk 0.3.0 → 0.4.0

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: 16735a1a43375efdebd16bc519ffbd0a1ddd5067f1f970ae7efd4d3f8f5f0de4
4
- data.tar.gz: 294b6e674282672231041190fdfa1127ff1ce5011b9a7ae08dc650757862724d
3
+ metadata.gz: 1a50f4eb29e8b1b964d365ccdc30749842efe091d659a5d62a7252d5af487fc2
4
+ data.tar.gz: ad82d90f8db9e0a416dff61ab76ab2a9084ccd39335e1a95e2b2c9c9b566cd18
5
5
  SHA512:
6
- metadata.gz: d6f6e5b5b414a8a411b414f161a4b0f1378ee0e872f3f666398bf345a4246f9910c92b0360f763378339f3603594a87fa0a5c605ddcaee5f93a764d99d954e44
7
- data.tar.gz: 4b76ae659c1b03d7f6cb7ffba6804f45c14ba64dc62ba79147bd6eda6ceb7930293ad692986baf83fcf5f6235bf3b9eb988aebe9cada3af354e6b1fcddc5d329
6
+ metadata.gz: db4b2cb2d0c4a3cb8e24667fc60e32f2172abb33f486c0613a4977a73412d15f10136a977724257a707af203314c5569375bb43447848fc27eb8e2b20ee721ef
7
+ data.tar.gz: ceb901dc21ad848fd0fabcbb8b299f2d7a3e101d3d295a5fbbbbdd49b086206f196b5996e4bf64ea40deadae893a3add09fc84df1890e80f5086ad44fa7e0dcf
@@ -45,7 +45,14 @@ module DangerPackwerk
45
45
 
46
46
  current_comment_count = 0
47
47
 
48
- violation_diff.added_violations.group_by(&:class_name).each do |_class_name, violations|
48
+ # The format for git.renamed_files is a T::Array[{after: "some/path/new", before: "some/path/old"}]
49
+ renamed_files = git.renamed_files.map { |before_after_file| before_after_file[:after] }
50
+
51
+ violations_to_comment_on = violation_diff.added_violations.reject do |violation|
52
+ renamed_files.include?(violation.file)
53
+ end
54
+
55
+ violations_to_comment_on.group_by(&:class_name).each do |_class_name, violations|
49
56
  break if current_comment_count >= max_comments
50
57
 
51
58
  location = T.must(violations.first).file_location
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module DangerPackwerk
5
- VERSION = '0.3.0'
5
+ VERSION = '0.4.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-packwerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-19 00:00:00.000000000 Z
11
+ date: 2022-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api