danger-missing_codeowners 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +19 -14
- data/lib/missing_codeowners/gem_version.rb +1 -1
- data/lib/missing_codeowners/plugin.rb +8 -2
- data/spec/missing_codeowners_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 970c2a9802600b8d3b23d23f23810f11d2c5b3490e32c21b1de0dc662f7a094a
|
|
4
|
+
data.tar.gz: a1ad21324215c762e3a69515f2b9b66281ef3a8955f238a9f9ff0867d3534f0a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9e820fc8a00114fe751122bcbd230fbeab691541b7e83ab5e2541cf558345461ebcf7b88b0b732fc8eed47ce401a66189acbb6620d441123e334bc81261e864
|
|
7
|
+
data.tar.gz: 3ac47d981dbc81ab5f733de36da6ff872720bd56a1911e02f0b6219554bf6abaee1e33c075d7012b9e26c648779ffbd2cfc6e5ab0f35881acacec536c27347b1
|
data/Gemfile.lock
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
danger-missing_codeowners (1.1
|
|
4
|
+
danger-missing_codeowners (1.2.1)
|
|
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.
|
|
11
|
+
addressable (2.8.6)
|
|
12
12
|
public_suffix (>= 2.0.2, < 6.0)
|
|
13
13
|
ast (2.4.2)
|
|
14
|
+
base64 (0.2.0)
|
|
14
15
|
claide (1.1.0)
|
|
15
16
|
claide-plugins (0.9.2)
|
|
16
17
|
cork
|
|
@@ -20,31 +21,31 @@ GEM
|
|
|
20
21
|
colored2 (3.1.2)
|
|
21
22
|
cork (0.3.0)
|
|
22
23
|
colored2 (~> 3.1)
|
|
23
|
-
danger (9.3
|
|
24
|
+
danger (9.4.3)
|
|
24
25
|
claide (~> 1.0)
|
|
25
26
|
claide-plugins (>= 0.9.2)
|
|
26
27
|
colored2 (~> 3.1)
|
|
27
28
|
cork (~> 0.1)
|
|
28
29
|
faraday (>= 0.9.0, < 3.0)
|
|
29
30
|
faraday-http-cache (~> 2.0)
|
|
30
|
-
git (~> 1.13
|
|
31
|
+
git (~> 1.13)
|
|
31
32
|
kramdown (~> 2.3)
|
|
32
33
|
kramdown-parser-gfm (~> 1.0)
|
|
33
34
|
no_proxy_fix
|
|
34
|
-
octokit (
|
|
35
|
+
octokit (>= 4.0)
|
|
35
36
|
terminal-table (>= 1, < 4)
|
|
36
37
|
danger-plugin-api (1.0.0)
|
|
37
38
|
danger (> 2.0)
|
|
38
39
|
diff-lcs (1.4.4)
|
|
39
|
-
faraday (2.
|
|
40
|
-
faraday-net_http (>= 2.0, < 3.
|
|
41
|
-
|
|
42
|
-
faraday-http-cache (2.5.0)
|
|
40
|
+
faraday (2.9.0)
|
|
41
|
+
faraday-net_http (>= 2.0, < 3.2)
|
|
42
|
+
faraday-http-cache (2.5.1)
|
|
43
43
|
faraday (>= 0.8)
|
|
44
|
-
faraday-net_http (3.0
|
|
44
|
+
faraday-net_http (3.1.0)
|
|
45
|
+
net-http
|
|
45
46
|
ffi (1.15.3)
|
|
46
47
|
formatador (0.3.0)
|
|
47
|
-
git (1.
|
|
48
|
+
git (1.19.1)
|
|
48
49
|
addressable (~> 2.8)
|
|
49
50
|
rchardet (~> 1.8)
|
|
50
51
|
guard (2.18.0)
|
|
@@ -72,11 +73,14 @@ GEM
|
|
|
72
73
|
method_source (1.0.0)
|
|
73
74
|
nap (1.1.0)
|
|
74
75
|
nenv (0.3.0)
|
|
76
|
+
net-http (0.4.1)
|
|
77
|
+
uri
|
|
75
78
|
no_proxy_fix (0.1.2)
|
|
76
79
|
notiffany (0.1.3)
|
|
77
80
|
nenv (~> 0.1)
|
|
78
81
|
shellany (~> 0.0)
|
|
79
|
-
octokit (
|
|
82
|
+
octokit (8.1.0)
|
|
83
|
+
base64
|
|
80
84
|
faraday (>= 1, < 3)
|
|
81
85
|
sawyer (~> 0.9)
|
|
82
86
|
open4 (1.3.4)
|
|
@@ -87,7 +91,7 @@ GEM
|
|
|
87
91
|
pry (0.14.1)
|
|
88
92
|
coderay (~> 1.1)
|
|
89
93
|
method_source (~> 1.0)
|
|
90
|
-
public_suffix (5.0.
|
|
94
|
+
public_suffix (5.0.4)
|
|
91
95
|
rainbow (3.0.0)
|
|
92
96
|
rake (10.5.0)
|
|
93
97
|
rb-fsevent (0.11.0)
|
|
@@ -121,7 +125,6 @@ GEM
|
|
|
121
125
|
rubocop-ast (1.8.0)
|
|
122
126
|
parser (>= 3.0.1.1)
|
|
123
127
|
ruby-progressbar (1.11.0)
|
|
124
|
-
ruby2_keywords (0.0.5)
|
|
125
128
|
sawyer (0.9.2)
|
|
126
129
|
addressable (>= 2.3.5)
|
|
127
130
|
faraday (>= 0.17.3, < 3)
|
|
@@ -130,10 +133,12 @@ GEM
|
|
|
130
133
|
unicode-display_width (>= 1.1.1, < 3)
|
|
131
134
|
thor (1.1.0)
|
|
132
135
|
unicode-display_width (2.0.0)
|
|
136
|
+
uri (0.13.0)
|
|
133
137
|
yard (0.9.26)
|
|
134
138
|
|
|
135
139
|
PLATFORMS
|
|
136
140
|
arm64-darwin-21
|
|
141
|
+
ruby
|
|
137
142
|
x86_64-darwin-20
|
|
138
143
|
|
|
139
144
|
DEPENDENCIES
|
|
@@ -59,7 +59,7 @@ module Danger
|
|
|
59
59
|
#
|
|
60
60
|
# @return [void]
|
|
61
61
|
#
|
|
62
|
-
def verify(*opts)
|
|
62
|
+
def verify(*opts, &block)
|
|
63
63
|
@verify_all_files ||= false
|
|
64
64
|
@max_number_of_files_to_report ||= 100
|
|
65
65
|
@severity ||= "error"
|
|
@@ -86,8 +86,12 @@ module Danger
|
|
|
86
86
|
markdown format_missing_owners_message(@files_missing_codeowners, @max_number_of_files_to_report)
|
|
87
87
|
danger_message = "Add CODEOWNERS rules to match all files."
|
|
88
88
|
@severity == "error" ? (fail danger_message) : (warn danger_message)
|
|
89
|
+
|
|
90
|
+
yield @files_missing_codeowners if block
|
|
89
91
|
else
|
|
90
92
|
log "No files missing CODEOWNERS."
|
|
93
|
+
|
|
94
|
+
yield [] if block
|
|
91
95
|
end
|
|
92
96
|
|
|
93
97
|
log "-----"
|
|
@@ -112,7 +116,9 @@ module Danger
|
|
|
112
116
|
end
|
|
113
117
|
|
|
114
118
|
def find_codeowners_file
|
|
115
|
-
|
|
119
|
+
return "CODEOWNERS" if File.exist?("CODEOWNERS")
|
|
120
|
+
|
|
121
|
+
directories = [".gitlab", ".github", "docs"]
|
|
116
122
|
paths = directories.map { |dir| File.join(dir, "CODEOWNERS") }
|
|
117
123
|
Dir.glob(paths).first || paths.first
|
|
118
124
|
end
|
|
@@ -75,6 +75,26 @@ module Danger
|
|
|
75
75
|
expect(@my_plugin.files_missing_codeowners.length).to eq(0)
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
+
it "calls the block with an empty array if there are no missing files" do
|
|
79
|
+
allow(@my_plugin).to receive(:git_modified_files).and_return(["any_file.yml", "any_file.go"])
|
|
80
|
+
|
|
81
|
+
@my_plugin.verify do |x|
|
|
82
|
+
expect(x).to eq []
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
expect(@my_plugin.files_missing_codeowners.length).to eq(0)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
it "calls the block with the list of missing files if there are missing files" do
|
|
89
|
+
allow(@my_plugin).to receive(:git_modified_files).and_return(["myfile"])
|
|
90
|
+
|
|
91
|
+
@my_plugin.verify do |x|
|
|
92
|
+
expect(x).to eq ["myfile"]
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
expect(@my_plugin.files_missing_codeowners.length).to eq(1)
|
|
96
|
+
end
|
|
97
|
+
|
|
78
98
|
it "fails when there are files without CODEOWNERS rules and severity is error" do
|
|
79
99
|
@my_plugin.verify_all_files = true
|
|
80
100
|
allow(@my_plugin).to receive(:git_all_files).and_return(["app/source.swift", ".swiftlint.yml"])
|
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.1
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- andre-alves
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-02-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: danger-plugin-api
|