danger-missing_codeowners 1.0.3 → 1.1.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: c96c6f07f74d912ae60feb08a802ebd4a1aa7807ece970520614c77a5847ec13
4
- data.tar.gz: a872b00996c8a7c42e3d73c648fb792a3e22acadb340cc53ff8865f54d43408c
3
+ metadata.gz: 9e93a3e15840e49e1966b6bfae9e59a8bfff84539b3cc1314e6224fab84464d9
4
+ data.tar.gz: 9288cb2e4e84f5c5dd09e4d0363f28276e3241d56c509f03075088401124fb4c
5
5
  SHA512:
6
- metadata.gz: 0ee3995c868961f7431b131748fe39e2b4f24689dd1fe1563e3de74bb33a6bb512fbc0a955029083933ae664193022f929dfc3040c9a8447a5affe62940a1388
7
- data.tar.gz: 52a36f59123b2ff15bc68af51a2f2bd93efab45c6f4c3d7e25f525cab493b326db3e8f7886c3690a4e1d4677a415b825f28524cdc4a93ac5bfccf55240515961
6
+ metadata.gz: 173a41e2f5fe25c8a953e2bd1dfc78900ee4012604f70692785f8475ffae110e8a7ddb21fc20c0f70dd50093c1102804d46566ad89e401f3fd6198d70c0f50df
7
+ data.tar.gz: 4e5a963fb0242853a0a0ad88637f05c2e3ae0c8ff69d8b124e403b79cbccecec866b9f23ea37512b0cdd5594e5a1f0ef6e14b79a9dd6c00e2cbc67f6de2ab06f
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-missing_codeowners (1.0.3)
4
+ danger-missing_codeowners (1.1.0)
5
5
  danger-plugin-api (~> 1.0)
6
6
  pathspec (~> 1.0.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.8.0)
12
- public_suffix (>= 2.0.2, < 5.0)
11
+ addressable (2.8.4)
12
+ public_suffix (>= 2.0.2, < 6.0)
13
13
  ast (2.4.2)
14
- claide (1.0.3)
14
+ claide (1.1.0)
15
15
  claide-plugins (0.9.2)
16
16
  cork
17
17
  nap
@@ -20,46 +20,32 @@ GEM
20
20
  colored2 (3.1.2)
21
21
  cork (0.3.0)
22
22
  colored2 (~> 3.1)
23
- danger (8.4.2)
23
+ danger (9.3.0)
24
24
  claide (~> 1.0)
25
25
  claide-plugins (>= 0.9.2)
26
26
  colored2 (~> 3.1)
27
27
  cork (~> 0.1)
28
- faraday (>= 0.9.0, < 2.0)
28
+ faraday (>= 0.9.0, < 3.0)
29
29
  faraday-http-cache (~> 2.0)
30
- git (~> 1.7)
30
+ git (~> 1.13.0)
31
31
  kramdown (~> 2.3)
32
32
  kramdown-parser-gfm (~> 1.0)
33
33
  no_proxy_fix
34
- octokit (~> 4.7)
34
+ octokit (~> 5.0)
35
35
  terminal-table (>= 1, < 4)
36
36
  danger-plugin-api (1.0.0)
37
37
  danger (> 2.0)
38
38
  diff-lcs (1.4.4)
39
- faraday (1.8.0)
40
- faraday-em_http (~> 1.0)
41
- faraday-em_synchrony (~> 1.0)
42
- faraday-excon (~> 1.1)
43
- faraday-httpclient (~> 1.0.1)
44
- faraday-net_http (~> 1.0)
45
- faraday-net_http_persistent (~> 1.1)
46
- faraday-patron (~> 1.0)
47
- faraday-rack (~> 1.0)
48
- multipart-post (>= 1.2, < 3)
39
+ faraday (2.7.5)
40
+ faraday-net_http (>= 2.0, < 3.1)
49
41
  ruby2_keywords (>= 0.0.4)
50
- faraday-em_http (1.0.0)
51
- faraday-em_synchrony (1.0.0)
52
- faraday-excon (1.1.0)
53
- faraday-http-cache (2.2.0)
42
+ faraday-http-cache (2.5.0)
54
43
  faraday (>= 0.8)
55
- faraday-httpclient (1.0.1)
56
- faraday-net_http (1.0.1)
57
- faraday-net_http_persistent (1.2.0)
58
- faraday-patron (1.0.0)
59
- faraday-rack (1.0.0)
44
+ faraday-net_http (3.0.2)
60
45
  ffi (1.15.3)
61
46
  formatador (0.3.0)
62
- git (1.9.1)
47
+ git (1.13.2)
48
+ addressable (~> 2.8)
63
49
  rchardet (~> 1.8)
64
50
  guard (2.18.0)
65
51
  formatador (>= 0.2.4)
@@ -75,7 +61,7 @@ GEM
75
61
  guard (~> 2.1)
76
62
  guard-compat (~> 1.1)
77
63
  rspec (>= 2.99.0, < 4.0)
78
- kramdown (2.3.1)
64
+ kramdown (2.4.0)
79
65
  rexml
80
66
  kramdown-parser-gfm (1.1.0)
81
67
  kramdown (~> 2.0)
@@ -84,16 +70,15 @@ GEM
84
70
  rb-inotify (>= 0.9.7)
85
71
  lumberjack (1.2.8)
86
72
  method_source (1.0.0)
87
- multipart-post (2.1.1)
88
73
  nap (1.1.0)
89
74
  nenv (0.3.0)
90
75
  no_proxy_fix (0.1.2)
91
76
  notiffany (0.1.3)
92
77
  nenv (~> 0.1)
93
78
  shellany (~> 0.0)
94
- octokit (4.21.0)
95
- faraday (>= 0.9)
96
- sawyer (~> 0.8.0, >= 0.5.3)
79
+ octokit (5.6.1)
80
+ faraday (>= 1, < 3)
81
+ sawyer (~> 0.9)
97
82
  open4 (1.3.4)
98
83
  parallel (1.20.1)
99
84
  parser (3.0.2.0)
@@ -102,7 +87,7 @@ GEM
102
87
  pry (0.14.1)
103
88
  coderay (~> 1.1)
104
89
  method_source (~> 1.0)
105
- public_suffix (4.0.6)
90
+ public_suffix (5.0.1)
106
91
  rainbow (3.0.0)
107
92
  rake (10.5.0)
108
93
  rb-fsevent (0.11.0)
@@ -137,9 +122,9 @@ GEM
137
122
  parser (>= 3.0.1.1)
138
123
  ruby-progressbar (1.11.0)
139
124
  ruby2_keywords (0.0.5)
140
- sawyer (0.8.2)
125
+ sawyer (0.9.2)
141
126
  addressable (>= 2.3.5)
142
- faraday (> 0.8, < 2.0)
127
+ faraday (>= 0.17.3, < 3)
143
128
  shellany (0.0.1)
144
129
  terminal-table (3.0.2)
145
130
  unicode-display_width (>= 1.1.1, < 3)
@@ -148,6 +133,7 @@ GEM
148
133
  yard (0.9.26)
149
134
 
150
135
  PLATFORMS
136
+ arm64-darwin-21
151
137
  x86_64-darwin-20
152
138
 
153
139
  DEPENDENCIES
@@ -163,4 +149,4 @@ DEPENDENCIES
163
149
  yard
164
150
 
165
151
  BUNDLED WITH
166
- 2.2.28
152
+ 2.2.29
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MissingCodeowners
4
- VERSION = "1.0.3"
4
+ VERSION = "1.1.0"
5
5
  end
@@ -40,6 +40,12 @@ module Danger
40
40
  # @return [Bool]
41
41
  attr_accessor :verbose
42
42
 
43
+ # The list of files to ignore. These are naive prefixes, so `foo/`
44
+ # will match `foo/bar`. No globbing.
45
+ #
46
+ # @return [Array<String>]
47
+ attr_accessor :ignored_files
48
+
43
49
  # Verifies files for missing owners.
44
50
  # Generates a `markdown` list of warnings for the prose in a corpus of
45
51
  # .markdown and .md files.
@@ -47,16 +53,23 @@ module Danger
47
53
  # @param [String] files
48
54
  # The list of files you want to verify, defaults to nil.
49
55
  # if nil, modified and added files from the diff will be used.
56
+ # @param [String] ignored_files
57
+ # The list of files you want to ignore, defaults to [].
58
+ # The files are treated as prefixes, so `foo/` will match `foo/bar`.
50
59
  #
51
60
  # @return [void]
52
61
  #
53
- def verify(files = nil)
62
+ def verify(*opts)
54
63
  @verify_all_files ||= false
55
64
  @max_number_of_files_to_report ||= 100
56
65
  @severity ||= "error"
57
66
  @verbose ||= false
67
+ @ignored_files ||= opts.first.kind_of?(Hash) ? opts.first[:ignored_files] : []
68
+ files = opts.first.kind_of?(Hash) ? opts.first[:files] : opts.first
58
69
 
59
- files_to_verify = files || files_from_git
70
+ files_to_verify = (files || files_from_git).delete_if do |file|
71
+ @ignored_files.any? { |ignored_file| file.start_with?(ignored_file) }
72
+ end
60
73
 
61
74
  log "Files to verify:"
62
75
  log files_to_verify.join("\n")
@@ -155,6 +155,15 @@ module Danger
155
155
  expect(@my_plugin.files_missing_codeowners).to include("added_file2.swift")
156
156
  expect(@my_plugin.files_missing_codeowners.length).to eq(1)
157
157
  end
158
+
159
+ it "ignores explicitly ignored files" do
160
+ allow(@my_plugin).to receive(:git_modified_files).and_return(["ignored_file.swift", "added_file.swift"])
161
+
162
+ @my_plugin.verify(ignored_files: ["ignored_file.swift"])
163
+
164
+ expect(@my_plugin.files_missing_codeowners).to include("added_file.swift")
165
+ expect(@my_plugin.files_missing_codeowners.length).to eq(1)
166
+ end
158
167
  end
159
168
 
160
169
  context "and invalid CODEOWNERS file" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-missing_codeowners
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - andre-alves
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-24 00:00:00.000000000 Z
11
+ date: 2023-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
211
  requirements: []
212
- rubygems_version: 3.0.3
212
+ rubygems_version: 3.2.15
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: A Danger plugin for checking if files have owners.