danger-android_lint 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +56 -53
- data/README.md +7 -0
- data/danger-android_lint.gemspec +1 -1
- data/lib/android_lint/gem_version.rb +1 -1
- data/lib/android_lint/plugin.rb +16 -9
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b36a61666df12470b0fc5a17a3a913095481058
|
4
|
+
data.tar.gz: 03ac321fa2d92734fc70fb8f4b173f2a6a002433
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8542399b5d4775d5c027c8947a3ed9b6391481a2ffc73a47d25a797c14eccec19ad9e54702a0bef64ebc84f13eaa6c80e5b5ad84716b56cf0bf70c70c0079c09
|
7
|
+
data.tar.gz: 73425c72e31d2cc71bc5d0eb314574f494e8f5e2856447c087ed843d98b66b5388e501bf06226b3047065c47b8413ca94033caeba44f657ee2abc7ae5e5328d4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 0.0.5
|
2
|
+
- Fix count number for issues ([@jettbow](https://github.com/jettbow))
|
3
|
+
- Add option for skipping gradle task ([@litmon](https://github.com/litmon))
|
4
|
+
|
1
5
|
# 0.0.4
|
2
6
|
- Add `filtering` parameter, default to false, to run lint only on modified files ([@leonhartX](https://github.com/leonhartX))
|
3
7
|
- Add support for GitHub's inline comments ([@leonhartX](https://github.com/leonhartX))
|
data/Gemfile.lock
CHANGED
@@ -1,48 +1,49 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-android_lint (0.0.
|
4
|
+
danger-android_lint (0.0.5)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
oga
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
addressable (2.5.
|
12
|
-
public_suffix (
|
11
|
+
addressable (2.5.2)
|
12
|
+
public_suffix (>= 2.0.2, < 4.0)
|
13
13
|
ansi (1.5.0)
|
14
14
|
ast (2.3.0)
|
15
|
-
claide (1.0.
|
15
|
+
claide (1.0.2)
|
16
16
|
claide-plugins (0.9.2)
|
17
17
|
cork
|
18
18
|
nap
|
19
19
|
open4 (~> 1.3)
|
20
|
-
coderay (1.1.
|
21
|
-
|
22
|
-
cork (0.
|
23
|
-
|
24
|
-
danger (
|
20
|
+
coderay (1.1.2)
|
21
|
+
colored2 (3.1.2)
|
22
|
+
cork (0.3.0)
|
23
|
+
colored2 (~> 3.1)
|
24
|
+
danger (5.5.5)
|
25
25
|
claide (~> 1.0)
|
26
26
|
claide-plugins (>= 0.9.2)
|
27
|
-
|
27
|
+
colored2 (~> 3.1)
|
28
28
|
cork (~> 0.1)
|
29
29
|
faraday (~> 0.9)
|
30
30
|
faraday-http-cache (~> 1.0)
|
31
31
|
git (~> 1)
|
32
32
|
kramdown (~> 1.5)
|
33
|
-
|
33
|
+
no_proxy_fix
|
34
|
+
octokit (~> 4.7)
|
34
35
|
terminal-table (~> 1)
|
35
36
|
danger-plugin-api (1.0.0)
|
36
37
|
danger (> 2.0)
|
37
|
-
diff-lcs (1.
|
38
|
-
faraday (0.
|
38
|
+
diff-lcs (1.3)
|
39
|
+
faraday (0.13.1)
|
39
40
|
multipart-post (>= 1.2, < 3)
|
40
41
|
faraday-http-cache (1.3.1)
|
41
42
|
faraday (~> 0.8)
|
42
|
-
ffi (1.9.
|
43
|
+
ffi (1.9.18)
|
43
44
|
formatador (0.2.5)
|
44
45
|
git (1.3.0)
|
45
|
-
guard (2.14.
|
46
|
+
guard (2.14.1)
|
46
47
|
formatador (>= 0.2.4)
|
47
48
|
listen (>= 2.7, < 4.0)
|
48
49
|
lumberjack (~> 1.0)
|
@@ -56,70 +57,72 @@ GEM
|
|
56
57
|
guard (~> 2.1)
|
57
58
|
guard-compat (~> 1.1)
|
58
59
|
rspec (>= 2.99.0, < 4.0)
|
59
|
-
kramdown (1.
|
60
|
+
kramdown (1.16.2)
|
60
61
|
listen (3.0.7)
|
61
62
|
rb-fsevent (>= 0.9.3)
|
62
63
|
rb-inotify (>= 0.9.7)
|
63
|
-
lumberjack (1.0.
|
64
|
-
method_source (0.
|
64
|
+
lumberjack (1.0.12)
|
65
|
+
method_source (0.9.0)
|
65
66
|
multipart-post (2.0.0)
|
66
67
|
nap (1.1.0)
|
67
68
|
nenv (0.3.0)
|
69
|
+
no_proxy_fix (0.1.2)
|
68
70
|
notiffany (0.1.1)
|
69
71
|
nenv (~> 0.1)
|
70
72
|
shellany (~> 0.0)
|
71
|
-
octokit (4.
|
73
|
+
octokit (4.7.0)
|
72
74
|
sawyer (~> 0.8.0, >= 0.5.3)
|
73
|
-
oga (2.
|
75
|
+
oga (2.11)
|
74
76
|
ast
|
75
77
|
ruby-ll (~> 2.1)
|
76
78
|
open4 (1.3.4)
|
77
|
-
|
78
|
-
|
79
|
+
parallel (1.12.0)
|
80
|
+
parser (2.4.0.2)
|
81
|
+
ast (~> 2.3)
|
79
82
|
powerpack (0.1.1)
|
80
|
-
pry (0.
|
83
|
+
pry (0.11.3)
|
81
84
|
coderay (~> 1.1.0)
|
82
|
-
method_source (~> 0.
|
83
|
-
|
84
|
-
|
85
|
-
|
85
|
+
method_source (~> 0.9.0)
|
86
|
+
public_suffix (2.0.5)
|
87
|
+
rainbow (2.2.2)
|
88
|
+
rake
|
86
89
|
rake (10.5.0)
|
87
|
-
rb-fsevent (0.
|
88
|
-
rb-inotify (0.9.
|
89
|
-
ffi (>= 0.5.0)
|
90
|
-
rspec (3.
|
91
|
-
rspec-core (~> 3.
|
92
|
-
rspec-expectations (~> 3.
|
93
|
-
rspec-mocks (~> 3.
|
94
|
-
rspec-core (3.
|
95
|
-
rspec-support (~> 3.
|
96
|
-
rspec-expectations (3.
|
90
|
+
rb-fsevent (0.10.2)
|
91
|
+
rb-inotify (0.9.10)
|
92
|
+
ffi (>= 0.5.0, < 2)
|
93
|
+
rspec (3.7.0)
|
94
|
+
rspec-core (~> 3.7.0)
|
95
|
+
rspec-expectations (~> 3.7.0)
|
96
|
+
rspec-mocks (~> 3.7.0)
|
97
|
+
rspec-core (3.7.0)
|
98
|
+
rspec-support (~> 3.7.0)
|
99
|
+
rspec-expectations (3.7.0)
|
97
100
|
diff-lcs (>= 1.2.0, < 2.0)
|
98
|
-
rspec-support (~> 3.
|
99
|
-
rspec-mocks (3.
|
101
|
+
rspec-support (~> 3.7.0)
|
102
|
+
rspec-mocks (3.7.0)
|
100
103
|
diff-lcs (>= 1.2.0, < 2.0)
|
101
|
-
rspec-support (~> 3.
|
102
|
-
rspec-support (3.
|
103
|
-
rubocop (0.
|
104
|
-
|
104
|
+
rspec-support (~> 3.7.0)
|
105
|
+
rspec-support (3.7.0)
|
106
|
+
rubocop (0.50.0)
|
107
|
+
parallel (~> 1.10)
|
108
|
+
parser (>= 2.3.3.1, < 3.0)
|
105
109
|
powerpack (~> 0.1)
|
106
|
-
rainbow (>=
|
110
|
+
rainbow (>= 2.2.2, < 3.0)
|
107
111
|
ruby-progressbar (~> 1.7)
|
108
112
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
109
113
|
ruby-ll (2.1.2)
|
110
114
|
ansi
|
111
115
|
ast
|
112
|
-
ruby-progressbar (1.
|
116
|
+
ruby-progressbar (1.9.0)
|
113
117
|
sawyer (0.8.1)
|
114
118
|
addressable (>= 2.3.5, < 2.6)
|
115
119
|
faraday (~> 0.8, < 1.0)
|
116
120
|
shellany (0.0.1)
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
yard (0.9.5)
|
121
|
+
terminal-table (1.8.0)
|
122
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
123
|
+
thor (0.20.0)
|
124
|
+
unicode-display_width (1.3.0)
|
125
|
+
yard (0.9.12)
|
123
126
|
|
124
127
|
PLATFORMS
|
125
128
|
ruby
|
@@ -133,8 +136,8 @@ DEPENDENCIES
|
|
133
136
|
pry
|
134
137
|
rake (~> 10.0)
|
135
138
|
rspec (~> 3.4)
|
136
|
-
rubocop (~> 0.
|
139
|
+
rubocop (~> 0.49)
|
137
140
|
yard (~> 0.8)
|
138
141
|
|
139
142
|
BUNDLED WITH
|
140
|
-
1.
|
143
|
+
1.16.0
|
data/README.md
CHANGED
@@ -49,6 +49,13 @@ android_lint.gradle_task = "lintMyFlavorDebug"
|
|
49
49
|
android_lint.lint
|
50
50
|
```
|
51
51
|
|
52
|
+
If you want to skip gradle task, setting the `skip_gradle_task` parameter to `true`.
|
53
|
+
|
54
|
+
```rb
|
55
|
+
android_lint.skip_gradle_task = true
|
56
|
+
android_lint.lint
|
57
|
+
```
|
58
|
+
|
52
59
|
#### Changing report's severity level
|
53
60
|
|
54
61
|
If you want to filter lint issues based on their severity level, you can do that by setting a value to `severity`. Bear in mind that you are filtering issues by the severity level you've set **and up**. Possible values are `Warning`, `Error` and `Fatal`. Default is `Warning` (which is everything).
|
data/danger-android_lint.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3.4'
|
31
31
|
|
32
32
|
# Linting code and docs
|
33
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
33
|
+
spec.add_development_dependency "rubocop", "~> 0.49"
|
34
34
|
spec.add_development_dependency "yard", "~> 0.8"
|
35
35
|
|
36
36
|
# Makes testing easy via `bundle exec guard`
|
data/lib/android_lint/plugin.rb
CHANGED
@@ -54,6 +54,9 @@ module Danger
|
|
54
54
|
# Only show messages within changed files.
|
55
55
|
attr_accessor :filtering
|
56
56
|
|
57
|
+
# Skip gradle task
|
58
|
+
attr_accessor :skip_gradle_task
|
59
|
+
|
57
60
|
# Calls lint task of your gradle project.
|
58
61
|
# It fails if `gradlew` cannot be found inside current directory.
|
59
62
|
# It fails if `severity` level is not a valid option.
|
@@ -61,7 +64,7 @@ module Danger
|
|
61
64
|
# @return [void]
|
62
65
|
#
|
63
66
|
def lint(inline_mode: false)
|
64
|
-
|
67
|
+
if !skip_gradle_task && !gradlew_exists?
|
65
68
|
fail("Could not find `gradlew` inside current directory")
|
66
69
|
return
|
67
70
|
end
|
@@ -71,7 +74,7 @@ module Danger
|
|
71
74
|
return
|
72
75
|
end
|
73
76
|
|
74
|
-
system "./gradlew #{gradle_task || 'lint'}"
|
77
|
+
system "./gradlew #{gradle_task || 'lint'}" unless skip_gradle_task
|
75
78
|
|
76
79
|
unless File.exists?(report_file)
|
77
80
|
fail("Lint report not found at `#{report_file}`. "\
|
@@ -86,7 +89,7 @@ module Danger
|
|
86
89
|
send_inline_comment(filtered_issues)
|
87
90
|
else
|
88
91
|
message = message_for_issues(filtered_issues)
|
89
|
-
markdown(message) unless
|
92
|
+
markdown("### AndroidLint found issues\n\n" + message) unless message.to_s.empty?
|
90
93
|
end
|
91
94
|
end
|
92
95
|
|
@@ -118,7 +121,7 @@ module Danger
|
|
118
121
|
end
|
119
122
|
|
120
123
|
def message_for_issues(issues)
|
121
|
-
message = "
|
124
|
+
message = ""
|
122
125
|
|
123
126
|
SEVERITY_LEVELS.reverse.each do |level|
|
124
127
|
filtered = issues.select{|issue| issue.get("severity") == level}
|
@@ -131,10 +134,8 @@ module Danger
|
|
131
134
|
def parse_results(results, heading)
|
132
135
|
target_files = (git.modified_files - git.deleted_files) + git.added_files
|
133
136
|
dir = "#{Dir.pwd}/"
|
134
|
-
|
135
|
-
|
136
|
-
message << "| File | Line | Reason |\n"
|
137
|
-
message << "| ---- | ---- | ------ |\n"
|
137
|
+
count = 0;
|
138
|
+
message = ""
|
138
139
|
|
139
140
|
results.each do |r|
|
140
141
|
location = r.xpath('location').first
|
@@ -142,9 +143,15 @@ module Danger
|
|
142
143
|
next unless !filtering || (target_files.include? filename)
|
143
144
|
line = location.get('line') || 'N/A'
|
144
145
|
reason = r.get('message')
|
145
|
-
|
146
|
+
count = count + 1
|
146
147
|
message << "`#{filename}` | #{line} | #{reason} \n"
|
147
148
|
end
|
149
|
+
if count != 0
|
150
|
+
header = "#### #{heading} (#{count})\n\n"
|
151
|
+
header << "| File | Line | Reason |\n"
|
152
|
+
header << "| ---- | ---- | ------ |\n"
|
153
|
+
message = header + message
|
154
|
+
end
|
148
155
|
|
149
156
|
message
|
150
157
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-android_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gustavo Barbosa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oga
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0.
|
89
|
+
version: '0.49'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0.
|
96
|
+
version: '0.49'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: yard
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|