danger-clorox 0.0.1 → 1.0.0
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/.gitignore +1 -0
- data/Gemfile.lock +29 -8
- data/lib/danger_plugin.rb +13 -9
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b674b32946188d77a7316cc4effc59201f1c487
|
4
|
+
data.tar.gz: d41d4a774ea2a346f5608ef6728d7fd602217ed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e169b4d61f39882461f8320cf4c8cc911f1e33709d0582384610fea7e338d4f337f1919b9790e9234e83bf1d15d10b7949ca8599b1f6af4d9f99a3d177b59ea
|
7
|
+
data.tar.gz: 8bcd4aebca1eca8c72acc5baac6562334a22b7b05d713eff6c58a51f4d83ab78ea6a5469b2d72106360a19cacef4b7b0fd92d1998c15ddef25513f3b743b3722
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-
|
4
|
+
danger-clorox (1.0.0)
|
5
5
|
danger
|
6
6
|
|
7
7
|
GEM
|
@@ -10,25 +10,37 @@ GEM
|
|
10
10
|
addressable (2.4.0)
|
11
11
|
bacon (1.2.0)
|
12
12
|
claide (1.0.0)
|
13
|
+
claide-plugins (0.9.1)
|
14
|
+
cork
|
15
|
+
nap
|
16
|
+
open4 (~> 1.3)
|
13
17
|
coderay (1.1.1)
|
14
18
|
colored (1.2)
|
15
|
-
cork (0.
|
19
|
+
cork (0.2.0)
|
16
20
|
colored (~> 1.2)
|
17
|
-
danger (
|
21
|
+
danger (3.1.0)
|
18
22
|
claide (~> 1.0)
|
23
|
+
claide-plugins (> 0.9.0)
|
19
24
|
colored (~> 1.2)
|
20
25
|
cork (~> 0.1)
|
21
|
-
faraday (~> 0)
|
26
|
+
faraday (~> 0.9)
|
27
|
+
faraday-http-cache (~> 1.0)
|
22
28
|
git (~> 1)
|
29
|
+
gitlab (~> 3.7.0)
|
30
|
+
kramdown (~> 1.5)
|
23
31
|
octokit (~> 4.2)
|
24
|
-
redcarpet (~> 3.3)
|
25
32
|
terminal-table (~> 1)
|
26
33
|
diff-lcs (1.2.5)
|
27
34
|
faraday (0.9.2)
|
28
35
|
multipart-post (>= 1.2, < 3)
|
36
|
+
faraday-http-cache (1.3.1)
|
37
|
+
faraday (~> 0.8)
|
29
38
|
ffi (1.9.10)
|
30
39
|
formatador (0.2.5)
|
31
40
|
git (1.3.0)
|
41
|
+
gitlab (3.7.0)
|
42
|
+
httparty (~> 0.13.0)
|
43
|
+
terminal-table
|
32
44
|
guard (2.14.0)
|
33
45
|
formatador (>= 0.2.4)
|
34
46
|
listen (>= 2.7, < 4.0)
|
@@ -43,6 +55,11 @@ GEM
|
|
43
55
|
guard (~> 2.1)
|
44
56
|
guard-compat (~> 1.1)
|
45
57
|
rspec (>= 2.99.0, < 4.0)
|
58
|
+
httparty (0.13.7)
|
59
|
+
json (~> 1.8)
|
60
|
+
multi_xml (>= 0.5.2)
|
61
|
+
json (1.8.3)
|
62
|
+
kramdown (1.12.0)
|
46
63
|
listen (3.0.7)
|
47
64
|
rb-fsevent (>= 0.9.3)
|
48
65
|
rb-inotify (>= 0.9.7)
|
@@ -53,13 +70,16 @@ GEM
|
|
53
70
|
metaclass (~> 0.0.1)
|
54
71
|
mocha-on-bacon (0.2.2)
|
55
72
|
mocha (>= 0.13.0)
|
73
|
+
multi_xml (0.5.5)
|
56
74
|
multipart-post (2.0.0)
|
75
|
+
nap (1.1.0)
|
57
76
|
nenv (0.3.0)
|
58
77
|
notiffany (0.1.0)
|
59
78
|
nenv (~> 0.1)
|
60
79
|
shellany (~> 0.0)
|
61
80
|
octokit (4.3.0)
|
62
81
|
sawyer (~> 0.7.0, >= 0.5.3)
|
82
|
+
open4 (1.3.4)
|
63
83
|
prettybacon (0.0.2)
|
64
84
|
bacon (~> 1.2)
|
65
85
|
pry (0.10.3)
|
@@ -70,7 +90,6 @@ GEM
|
|
70
90
|
rb-fsevent (0.9.7)
|
71
91
|
rb-inotify (0.9.7)
|
72
92
|
ffi (>= 0.5.0)
|
73
|
-
redcarpet (3.3.4)
|
74
93
|
rspec (3.5.0)
|
75
94
|
rspec-core (~> 3.5.0)
|
76
95
|
rspec-expectations (~> 3.5.0)
|
@@ -89,8 +108,10 @@ GEM
|
|
89
108
|
faraday (~> 0.8, < 0.10)
|
90
109
|
shellany (0.0.1)
|
91
110
|
slop (3.6.0)
|
92
|
-
terminal-table (1.
|
111
|
+
terminal-table (1.7.0)
|
112
|
+
unicode-display_width (~> 1.1)
|
93
113
|
thor (0.19.1)
|
114
|
+
unicode-display_width (1.1.0)
|
94
115
|
|
95
116
|
PLATFORMS
|
96
117
|
ruby
|
@@ -98,7 +119,7 @@ PLATFORMS
|
|
98
119
|
DEPENDENCIES
|
99
120
|
bacon
|
100
121
|
bundler (~> 1.3)
|
101
|
-
danger-
|
122
|
+
danger-clorox!
|
102
123
|
guard (~> 2.14)
|
103
124
|
guard-rspec (~> 4.7)
|
104
125
|
listen (= 3.0.7)
|
data/lib/danger_plugin.rb
CHANGED
@@ -3,15 +3,15 @@ module Danger
|
|
3
3
|
|
4
4
|
class DangerClorox < Plugin
|
5
5
|
|
6
|
+
# Allows you to specify a directory from where clorox will be run.
|
7
|
+
attr_accessor :directory
|
8
|
+
|
6
9
|
# Checks presence of file header comments. Will fail if `clorox` cannot be installed correctly.
|
7
10
|
# Generates a `markdown` list of dirty Objective-C and Swift files
|
8
11
|
#
|
9
|
-
# @param [String] files
|
10
|
-
# A globbed string which should return the files that you want to check, defaults to nil.
|
11
|
-
# if nil, modified and added files from the diff will be used.
|
12
12
|
# @return [void]
|
13
13
|
#
|
14
|
-
def check_files
|
14
|
+
def check_files
|
15
15
|
# Installs clorox if needed
|
16
16
|
system "pip install --target /tmp/danger_clorox clorox" unless clorox_installed?
|
17
17
|
|
@@ -21,17 +21,21 @@ module Danger
|
|
21
21
|
return
|
22
22
|
end
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
clorox_command = "python /tmp/danger_clorox/clorox/clorox.py "
|
25
|
+
clorox_command += "--path #{directory ? directory : '.'} "
|
26
|
+
clorox_command += "--inspection "
|
27
|
+
clorox_command += "--report json"
|
26
28
|
|
27
29
|
require 'json'
|
28
|
-
|
30
|
+
result_json = JSON.parse(`(#{clorox_command})`)
|
29
31
|
|
30
32
|
message = ''
|
31
|
-
if
|
33
|
+
if result_json['status'] == 'dirty'
|
32
34
|
message = "### Clorox has found issues\n"
|
33
35
|
message << "Please, remove the header from the files below (those comments on the top of your file):\n\n"
|
34
|
-
|
36
|
+
result_json['files'].each do |r|
|
37
|
+
message << "- #{r}\n"
|
38
|
+
end
|
35
39
|
markdown message
|
36
40
|
end
|
37
41
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-clorox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gustavo Barbosa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger
|