danger-iblinter 0.0.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 +7 -0
- data/.gitignore +54 -0
- data/.rubocop.yml +152 -0
- data/.travis.yml +12 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +136 -0
- data/Guardfile +19 -0
- data/LICENSE.txt +22 -0
- data/README.md +26 -0
- data/Rakefile +23 -0
- data/danger-iblinter.gemspec +49 -0
- data/lib/danger_iblinter.rb +3 -0
- data/lib/danger_plugin.rb +3 -0
- data/lib/iblinter/gem_version.rb +5 -0
- data/lib/iblinter/iblinter.rb +39 -0
- data/lib/iblinter/plugin.rb +82 -0
- data/spec/iblinter_spec.rb +14 -0
- data/spec/plugin_spec.rb +43 -0
- data/spec/spec_helper.rb +67 -0
- data/spec/support/fixtures/github_pr.json +3 -0
- data/spec/support/fixtures/iblinter.json +12 -0
- metadata +209 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: a0baf75368108ddea857f6488eb5ffe335684602d3b536b0c3a156ebf4e62684
|
|
4
|
+
data.tar.gz: 9195b9a5dd0b940c822d7ff8814b5581685f8c75fe6ce243baa6d4eb8120d1fb
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 39b02ae54f23390ac9f1b16328a334c5b663c110157dfab486a6a2885ff4b4bd3fb417419e53c4f6406c493a99a65fb988da7e74b08cc28063dff380a785ab6c
|
|
7
|
+
data.tar.gz: 58aa98104a0775d453c2f6242575e172b2266670cd5c6ea4c7975aeaa39c9f78697858dc3195ae92da8c689da79d753147526c865a951c4261c8459422b12f18
|
data/.gitignore
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
### https://raw.github.com/github/gitignore/7af8eea00b37b330af2b9de94170f1d6aeafb1f0/Ruby.gitignore
|
|
2
|
+
|
|
3
|
+
*.gem
|
|
4
|
+
*.rbc
|
|
5
|
+
/.config
|
|
6
|
+
/coverage/
|
|
7
|
+
/InstalledFiles
|
|
8
|
+
/pkg/
|
|
9
|
+
/spec/reports/
|
|
10
|
+
/spec/examples.txt
|
|
11
|
+
/test/tmp/
|
|
12
|
+
/test/version_tmp/
|
|
13
|
+
/tmp/
|
|
14
|
+
|
|
15
|
+
# Used by dotenv library to load environment variables.
|
|
16
|
+
# .env
|
|
17
|
+
|
|
18
|
+
## Specific to RubyMotion:
|
|
19
|
+
.dat*
|
|
20
|
+
.repl_history
|
|
21
|
+
build/
|
|
22
|
+
*.bridgesupport
|
|
23
|
+
build-iPhoneOS/
|
|
24
|
+
build-iPhoneSimulator/
|
|
25
|
+
|
|
26
|
+
## Specific to RubyMotion (use of CocoaPods):
|
|
27
|
+
#
|
|
28
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
|
29
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
|
30
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
|
31
|
+
#
|
|
32
|
+
# vendor/Pods/
|
|
33
|
+
|
|
34
|
+
## Documentation cache and generated files:
|
|
35
|
+
/.yardoc/
|
|
36
|
+
/_yardoc/
|
|
37
|
+
/doc/
|
|
38
|
+
/rdoc/
|
|
39
|
+
|
|
40
|
+
## Environment normalization:
|
|
41
|
+
/.bundle/
|
|
42
|
+
/vendor/bundle
|
|
43
|
+
/lib/bundler/man/
|
|
44
|
+
|
|
45
|
+
# for a library or gem, you might want to ignore these files since the code is
|
|
46
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
47
|
+
# Gemfile.lock
|
|
48
|
+
# .ruby-version
|
|
49
|
+
# .ruby-gemset
|
|
50
|
+
|
|
51
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
52
|
+
.rvmrc
|
|
53
|
+
|
|
54
|
+
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Defaults can be found here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
|
2
|
+
|
|
3
|
+
# If you don't like these settings, just delete this file :)
|
|
4
|
+
|
|
5
|
+
AllCops:
|
|
6
|
+
TargetRubyVersion: 2.5
|
|
7
|
+
|
|
8
|
+
Style/StringLiterals:
|
|
9
|
+
EnforcedStyle: double_quotes
|
|
10
|
+
Enabled: true
|
|
11
|
+
|
|
12
|
+
# kind_of? is a good way to check a type
|
|
13
|
+
Style/ClassCheck:
|
|
14
|
+
EnforcedStyle: kind_of?
|
|
15
|
+
|
|
16
|
+
# It's better to be more explicit about the type
|
|
17
|
+
Style/BracesAroundHashParameters:
|
|
18
|
+
Enabled: false
|
|
19
|
+
|
|
20
|
+
# specs sometimes have useless assignments, which is fine
|
|
21
|
+
Lint/UselessAssignment:
|
|
22
|
+
Exclude:
|
|
23
|
+
- '**/spec/**/*'
|
|
24
|
+
|
|
25
|
+
# We could potentially enable the 2 below:
|
|
26
|
+
Layout/IndentHash:
|
|
27
|
+
Enabled: false
|
|
28
|
+
|
|
29
|
+
Layout/AlignHash:
|
|
30
|
+
Enabled: false
|
|
31
|
+
|
|
32
|
+
# HoundCI doesn't like this rule
|
|
33
|
+
Layout/DotPosition:
|
|
34
|
+
Enabled: false
|
|
35
|
+
|
|
36
|
+
# We allow !! as it's an easy way to convert ot boolean
|
|
37
|
+
Style/DoubleNegation:
|
|
38
|
+
Enabled: false
|
|
39
|
+
|
|
40
|
+
# Cop supports --auto-correct.
|
|
41
|
+
Lint/UnusedBlockArgument:
|
|
42
|
+
Enabled: false
|
|
43
|
+
|
|
44
|
+
# We want to allow class Fastlane::Class
|
|
45
|
+
Style/ClassAndModuleChildren:
|
|
46
|
+
Enabled: false
|
|
47
|
+
|
|
48
|
+
Metrics/AbcSize:
|
|
49
|
+
Max: 60
|
|
50
|
+
|
|
51
|
+
# The %w might be confusing for new users
|
|
52
|
+
Style/WordArray:
|
|
53
|
+
MinSize: 19
|
|
54
|
+
|
|
55
|
+
# raise and fail are both okay
|
|
56
|
+
Style/SignalException:
|
|
57
|
+
Enabled: false
|
|
58
|
+
|
|
59
|
+
# Better too much 'return' than one missing
|
|
60
|
+
Style/RedundantReturn:
|
|
61
|
+
Enabled: false
|
|
62
|
+
|
|
63
|
+
# Having if in the same line might not always be good
|
|
64
|
+
Style/IfUnlessModifier:
|
|
65
|
+
Enabled: false
|
|
66
|
+
|
|
67
|
+
# and and or is okay
|
|
68
|
+
Style/AndOr:
|
|
69
|
+
Enabled: false
|
|
70
|
+
|
|
71
|
+
# Configuration parameters: CountComments.
|
|
72
|
+
Metrics/ClassLength:
|
|
73
|
+
Max: 350
|
|
74
|
+
|
|
75
|
+
Metrics/CyclomaticComplexity:
|
|
76
|
+
Max: 17
|
|
77
|
+
|
|
78
|
+
# Configuration parameters: AllowURI, URISchemes.
|
|
79
|
+
Metrics/LineLength:
|
|
80
|
+
Max: 370
|
|
81
|
+
|
|
82
|
+
# Configuration parameters: CountKeywordArgs.
|
|
83
|
+
Metrics/ParameterLists:
|
|
84
|
+
Max: 10
|
|
85
|
+
|
|
86
|
+
Metrics/PerceivedComplexity:
|
|
87
|
+
Max: 18
|
|
88
|
+
|
|
89
|
+
# Sometimes it's easier to read without guards
|
|
90
|
+
Style/GuardClause:
|
|
91
|
+
Enabled: false
|
|
92
|
+
|
|
93
|
+
# something = if something_else
|
|
94
|
+
# that's confusing
|
|
95
|
+
Style/ConditionalAssignment:
|
|
96
|
+
Enabled: false
|
|
97
|
+
|
|
98
|
+
# Better to have too much self than missing a self
|
|
99
|
+
Style/RedundantSelf:
|
|
100
|
+
Enabled: false
|
|
101
|
+
|
|
102
|
+
Metrics/MethodLength:
|
|
103
|
+
Max: 60
|
|
104
|
+
|
|
105
|
+
# We're not there yet
|
|
106
|
+
Style/Documentation:
|
|
107
|
+
Enabled: false
|
|
108
|
+
|
|
109
|
+
# Adds complexity
|
|
110
|
+
Style/IfInsideElse:
|
|
111
|
+
Enabled: false
|
|
112
|
+
|
|
113
|
+
# danger specific
|
|
114
|
+
|
|
115
|
+
Style/BlockComments:
|
|
116
|
+
Enabled: false
|
|
117
|
+
|
|
118
|
+
Layout/MultilineMethodCallIndentation:
|
|
119
|
+
EnforcedStyle: indented
|
|
120
|
+
|
|
121
|
+
# FIXME: 25
|
|
122
|
+
Metrics/BlockLength:
|
|
123
|
+
Max: 345
|
|
124
|
+
Exclude:
|
|
125
|
+
- "**/*_spec.rb"
|
|
126
|
+
|
|
127
|
+
Style/MixinGrouping:
|
|
128
|
+
Enabled: false
|
|
129
|
+
|
|
130
|
+
Style/FileName:
|
|
131
|
+
Enabled: false
|
|
132
|
+
|
|
133
|
+
Layout/IndentHeredoc:
|
|
134
|
+
Enabled: false
|
|
135
|
+
|
|
136
|
+
Style/SpecialGlobalVars:
|
|
137
|
+
Enabled: false
|
|
138
|
+
|
|
139
|
+
PercentLiteralDelimiters:
|
|
140
|
+
PreferredDelimiters:
|
|
141
|
+
"%": ()
|
|
142
|
+
"%i": ()
|
|
143
|
+
"%q": ()
|
|
144
|
+
"%Q": ()
|
|
145
|
+
"%r": "{}"
|
|
146
|
+
"%s": ()
|
|
147
|
+
"%w": ()
|
|
148
|
+
"%W": ()
|
|
149
|
+
"%x": ()
|
|
150
|
+
|
|
151
|
+
Security/YAMLLoad:
|
|
152
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
danger-iblinter (0.0.1)
|
|
5
|
+
danger-plugin-api (~> 1.0)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
addressable (2.5.2)
|
|
11
|
+
public_suffix (>= 2.0.2, < 4.0)
|
|
12
|
+
ast (2.4.0)
|
|
13
|
+
claide (1.0.2)
|
|
14
|
+
claide-plugins (0.9.2)
|
|
15
|
+
cork
|
|
16
|
+
nap
|
|
17
|
+
open4 (~> 1.3)
|
|
18
|
+
coderay (1.1.2)
|
|
19
|
+
colored2 (3.1.2)
|
|
20
|
+
cork (0.3.0)
|
|
21
|
+
colored2 (~> 3.1)
|
|
22
|
+
danger (5.11.1)
|
|
23
|
+
claide (~> 1.0)
|
|
24
|
+
claide-plugins (>= 0.9.2)
|
|
25
|
+
colored2 (~> 3.1)
|
|
26
|
+
cork (~> 0.1)
|
|
27
|
+
faraday (~> 0.9)
|
|
28
|
+
faraday-http-cache (~> 1.0)
|
|
29
|
+
git (~> 1.5)
|
|
30
|
+
kramdown (~> 1.5)
|
|
31
|
+
no_proxy_fix
|
|
32
|
+
octokit (~> 4.7)
|
|
33
|
+
terminal-table (~> 1)
|
|
34
|
+
danger-plugin-api (1.0.0)
|
|
35
|
+
danger (> 2.0)
|
|
36
|
+
diff-lcs (1.3)
|
|
37
|
+
faraday (0.15.4)
|
|
38
|
+
multipart-post (>= 1.2, < 3)
|
|
39
|
+
faraday-http-cache (1.3.1)
|
|
40
|
+
faraday (~> 0.8)
|
|
41
|
+
ffi (1.10.0)
|
|
42
|
+
formatador (0.2.5)
|
|
43
|
+
git (1.5.0)
|
|
44
|
+
guard (2.15.0)
|
|
45
|
+
formatador (>= 0.2.4)
|
|
46
|
+
listen (>= 2.7, < 4.0)
|
|
47
|
+
lumberjack (>= 1.0.12, < 2.0)
|
|
48
|
+
nenv (~> 0.1)
|
|
49
|
+
notiffany (~> 0.0)
|
|
50
|
+
pry (>= 0.9.12)
|
|
51
|
+
shellany (~> 0.0)
|
|
52
|
+
thor (>= 0.18.1)
|
|
53
|
+
guard-compat (1.2.1)
|
|
54
|
+
guard-rspec (4.7.3)
|
|
55
|
+
guard (~> 2.1)
|
|
56
|
+
guard-compat (~> 1.1)
|
|
57
|
+
rspec (>= 2.99.0, < 4.0)
|
|
58
|
+
jaro_winkler (1.5.2)
|
|
59
|
+
kramdown (1.17.0)
|
|
60
|
+
listen (3.0.7)
|
|
61
|
+
rb-fsevent (>= 0.9.3)
|
|
62
|
+
rb-inotify (>= 0.9.7)
|
|
63
|
+
lumberjack (1.0.13)
|
|
64
|
+
method_source (0.9.2)
|
|
65
|
+
multipart-post (2.0.0)
|
|
66
|
+
nap (1.1.0)
|
|
67
|
+
nenv (0.3.0)
|
|
68
|
+
no_proxy_fix (0.1.2)
|
|
69
|
+
notiffany (0.1.1)
|
|
70
|
+
nenv (~> 0.1)
|
|
71
|
+
shellany (~> 0.0)
|
|
72
|
+
octokit (4.13.0)
|
|
73
|
+
sawyer (~> 0.8.0, >= 0.5.3)
|
|
74
|
+
open4 (1.3.4)
|
|
75
|
+
parallel (1.13.0)
|
|
76
|
+
parser (2.6.0.0)
|
|
77
|
+
ast (~> 2.4.0)
|
|
78
|
+
powerpack (0.1.2)
|
|
79
|
+
pry (0.12.2)
|
|
80
|
+
coderay (~> 1.1.0)
|
|
81
|
+
method_source (~> 0.9.0)
|
|
82
|
+
public_suffix (3.0.3)
|
|
83
|
+
rainbow (3.0.0)
|
|
84
|
+
rake (10.5.0)
|
|
85
|
+
rb-fsevent (0.10.3)
|
|
86
|
+
rb-inotify (0.10.0)
|
|
87
|
+
ffi (~> 1.0)
|
|
88
|
+
rspec (3.8.0)
|
|
89
|
+
rspec-core (~> 3.8.0)
|
|
90
|
+
rspec-expectations (~> 3.8.0)
|
|
91
|
+
rspec-mocks (~> 3.8.0)
|
|
92
|
+
rspec-core (3.8.0)
|
|
93
|
+
rspec-support (~> 3.8.0)
|
|
94
|
+
rspec-expectations (3.8.2)
|
|
95
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
96
|
+
rspec-support (~> 3.8.0)
|
|
97
|
+
rspec-mocks (3.8.0)
|
|
98
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
99
|
+
rspec-support (~> 3.8.0)
|
|
100
|
+
rspec-support (3.8.0)
|
|
101
|
+
rubocop (0.63.1)
|
|
102
|
+
jaro_winkler (~> 1.5.1)
|
|
103
|
+
parallel (~> 1.10)
|
|
104
|
+
parser (>= 2.5, != 2.5.1.1)
|
|
105
|
+
powerpack (~> 0.1)
|
|
106
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
107
|
+
ruby-progressbar (~> 1.7)
|
|
108
|
+
unicode-display_width (~> 1.4.0)
|
|
109
|
+
ruby-progressbar (1.10.0)
|
|
110
|
+
sawyer (0.8.1)
|
|
111
|
+
addressable (>= 2.3.5, < 2.6)
|
|
112
|
+
faraday (~> 0.8, < 1.0)
|
|
113
|
+
shellany (0.0.1)
|
|
114
|
+
terminal-table (1.8.0)
|
|
115
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
|
116
|
+
thor (0.20.3)
|
|
117
|
+
unicode-display_width (1.4.1)
|
|
118
|
+
yard (0.9.18)
|
|
119
|
+
|
|
120
|
+
PLATFORMS
|
|
121
|
+
ruby
|
|
122
|
+
|
|
123
|
+
DEPENDENCIES
|
|
124
|
+
bundler (~> 1.3)
|
|
125
|
+
danger-iblinter!
|
|
126
|
+
guard (~> 2.14)
|
|
127
|
+
guard-rspec (~> 4.7)
|
|
128
|
+
listen (= 3.0.7)
|
|
129
|
+
pry
|
|
130
|
+
rake (~> 10.0)
|
|
131
|
+
rspec (~> 3.4)
|
|
132
|
+
rubocop
|
|
133
|
+
yard
|
|
134
|
+
|
|
135
|
+
BUNDLED WITH
|
|
136
|
+
1.16.2
|
data/Guardfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# A guardfile for making Danger Plugins
|
|
2
|
+
# For more info see https://github.com/guard/guard#readme
|
|
3
|
+
|
|
4
|
+
# To run, use `bundle exec guard`.
|
|
5
|
+
|
|
6
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
|
7
|
+
require 'guard/rspec/dsl'
|
|
8
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
|
9
|
+
|
|
10
|
+
# RSpec files
|
|
11
|
+
rspec = dsl.rspec
|
|
12
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
|
13
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
|
14
|
+
watch(rspec.spec_files)
|
|
15
|
+
|
|
16
|
+
# Ruby files
|
|
17
|
+
ruby = dsl.ruby
|
|
18
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
|
19
|
+
end
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2019 Yuta Saito <kateinoigakukun@gmail.com>
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Danger IBLinter
|
|
2
|
+
|
|
3
|
+
A danger plugin for IBLinter.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```ruby
|
|
8
|
+
gem 'danger-swiftlint'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This plugin requires `iblinter` executable binary.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
iblinter.binary_path = "./Pods/IBLinter/bin/iblinter"
|
|
17
|
+
iblinter.lint("./path/to/project", fail_on_warning: true, inline_mode: true)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Development
|
|
21
|
+
|
|
22
|
+
1. Clone this repo
|
|
23
|
+
2. Run `bundle install` to setup dependencies.
|
|
24
|
+
3. Run `bundle exec rake spec` to run the tests.
|
|
25
|
+
4. Use `bundle exec guard` to automatically have tests run as you make changes.
|
|
26
|
+
5. Make your changes.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'bundler/gem_tasks'
|
|
2
|
+
require 'rspec/core/rake_task'
|
|
3
|
+
require 'rubocop/rake_task'
|
|
4
|
+
|
|
5
|
+
RSpec::Core::RakeTask.new(:specs)
|
|
6
|
+
|
|
7
|
+
task default: :specs
|
|
8
|
+
|
|
9
|
+
task :spec do
|
|
10
|
+
Rake::Task['specs'].invoke
|
|
11
|
+
Rake::Task['rubocop'].invoke
|
|
12
|
+
Rake::Task['spec_docs'].invoke
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
desc 'Run RuboCop on the lib/specs directory'
|
|
16
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
|
17
|
+
task.patterns = ['lib/**/*.rb', 'spec/**/*.rb']
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
desc 'Ensure that the plugin passes `danger plugins lint`'
|
|
21
|
+
task :spec_docs do
|
|
22
|
+
sh 'bundle exec danger plugins lint'
|
|
23
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'iblinter/gem_version.rb'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = 'danger-iblinter'
|
|
8
|
+
spec.version = IBLinter::VERSION
|
|
9
|
+
spec.authors = ['Yuta Saito']
|
|
10
|
+
spec.email = ['kateinoigakukun@gmail.com']
|
|
11
|
+
spec.description = %q{A danger plugin for linting Interface Builder files with IBLinter.}
|
|
12
|
+
spec.summary = %q{A danger plugin for linting Interface Builder files with IBLinter.}
|
|
13
|
+
spec.homepage = 'https://github.com/IBDecodable/danger-ruby-iblinter'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files`.split($/)
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
|
|
22
|
+
|
|
23
|
+
# General ruby development
|
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
|
26
|
+
|
|
27
|
+
# Testing support
|
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.4'
|
|
29
|
+
|
|
30
|
+
# Linting code and docs
|
|
31
|
+
spec.add_development_dependency "rubocop"
|
|
32
|
+
spec.add_development_dependency "yard"
|
|
33
|
+
|
|
34
|
+
# Makes testing easy via `bundle exec guard`
|
|
35
|
+
spec.add_development_dependency 'guard', '~> 2.14'
|
|
36
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.7'
|
|
37
|
+
|
|
38
|
+
# If you want to work on older builds of ruby
|
|
39
|
+
spec.add_development_dependency 'listen', '3.0.7'
|
|
40
|
+
|
|
41
|
+
# This gives you the chance to run a REPL inside your tests
|
|
42
|
+
# via:
|
|
43
|
+
#
|
|
44
|
+
# require 'pry'
|
|
45
|
+
# binding.pry
|
|
46
|
+
#
|
|
47
|
+
# This will stop test execution and let you inspect the results
|
|
48
|
+
spec.add_development_dependency 'pry'
|
|
49
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class IBLinter
|
|
4
|
+
def initialize(binary_path)
|
|
5
|
+
@binary_path = binary_path
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def run(command)
|
|
9
|
+
`#{command}`
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def lint(path, options)
|
|
13
|
+
Dir.chdir path
|
|
14
|
+
JSON.parse(run(lint_command(options)))
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def lint_command(options)
|
|
18
|
+
abs_binary_path = @binary_path.nil? ? "iblinter" : File.absolute_path(@binary_path)
|
|
19
|
+
"#{abs_binary_path} lint #{arguments(options.merge(reporter: 'json'))}"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Parse options into shell arguments.
|
|
23
|
+
# Reference https://github.com/ashfurrow/danger-ruby-swiftlint/blob/0af6d5aff38dc666352ea3750266fb7630d88bdd/ext/swiftlint/swiftlint.rb#L38
|
|
24
|
+
def arguments(options)
|
|
25
|
+
options.
|
|
26
|
+
reject { |_key, value| value.nil? }.
|
|
27
|
+
map { |key, value| value.kind_of?(TrueClass) ? [key, ""] : [key, value] }.
|
|
28
|
+
# map booleans arguments equal false
|
|
29
|
+
map { |key, value| value.kind_of?(FalseClass) ? ["no-#{key}", ""] : [key, value] }.
|
|
30
|
+
# replace underscore by hyphen
|
|
31
|
+
map { |key, value| [key.to_s.tr("_", "-"), value] }.
|
|
32
|
+
# prepend "--" into the argument
|
|
33
|
+
map { |key, value| ["--#{key}", value] }.
|
|
34
|
+
# reduce everything into a single string
|
|
35
|
+
reduce("") { |args, option| "#{args} #{option[0]} #{option[1]}" }.
|
|
36
|
+
# strip leading spaces
|
|
37
|
+
strip
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "./iblinter"
|
|
4
|
+
|
|
5
|
+
module Danger
|
|
6
|
+
# Lint Interface Builder files inside your projects.
|
|
7
|
+
# This is done using the [IBLinter](https://github.com/IBDecodable/IBLinter) tool.
|
|
8
|
+
#
|
|
9
|
+
# @example Specifying custom config file and path.
|
|
10
|
+
#
|
|
11
|
+
# iblinter.config_file = ".iblinter.yml"
|
|
12
|
+
# iblinter.lint
|
|
13
|
+
#
|
|
14
|
+
# @see IBDecodable/IBLinter
|
|
15
|
+
# @tags swift
|
|
16
|
+
#
|
|
17
|
+
class DangerIBLinter < Plugin
|
|
18
|
+
# The path to IBLinter"s execution
|
|
19
|
+
# @return [void]
|
|
20
|
+
attr_accessor :binary_path
|
|
21
|
+
|
|
22
|
+
# Lints IB files. Will fail if `iblinter` cannot be installed correctly.
|
|
23
|
+
# @return [void]
|
|
24
|
+
#
|
|
25
|
+
def lint(path = Dir.pwd, fail_on_warning: false, inline_mode: true, options: {})
|
|
26
|
+
raise "iblinter is not installed" unless File.exist? @binary_path
|
|
27
|
+
|
|
28
|
+
issues = iblinter.lint(path, options)
|
|
29
|
+
return if issues.empty?
|
|
30
|
+
|
|
31
|
+
errors = issues.select { |v| v["level"] == "error" }
|
|
32
|
+
warnings = issues.select { |v| v["level"] == "warning" }
|
|
33
|
+
|
|
34
|
+
if inline_mode
|
|
35
|
+
send_inline_comment(warnings, fail_on_warning ? :fail : :warn)
|
|
36
|
+
send_inline_comment(errors, :fail)
|
|
37
|
+
else
|
|
38
|
+
message = "### IBLinter found issues\n\n"
|
|
39
|
+
message << markdown_issues(errors, "Errors", ":rotating_light:") unless errors.empty?
|
|
40
|
+
message << markdown_issues(warnings, "Warnings", ":warning:") unless warnings.empty?
|
|
41
|
+
markdown message
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
if errors.count.positive?
|
|
45
|
+
fail "Failed due to IBLinter errors"
|
|
46
|
+
elsif fail_on_warning && warnings.count.positive?
|
|
47
|
+
fail "Failed due to IBLinter warnings"
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Instantiate iblinter
|
|
52
|
+
# @return [IBLinter]
|
|
53
|
+
def iblinter
|
|
54
|
+
IBLinter.new(@binary_path)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
private
|
|
58
|
+
|
|
59
|
+
def markdown_issues(results, heading, emoji)
|
|
60
|
+
message = "#### #{heading}\n\n"
|
|
61
|
+
|
|
62
|
+
message << "| | File | Hint |\n"
|
|
63
|
+
message << "|---| ---- | -----|\n"
|
|
64
|
+
|
|
65
|
+
results.each do |r|
|
|
66
|
+
filename = r["file"].split("/").last
|
|
67
|
+
hint = r["message"]
|
|
68
|
+
message << "| #{emoji} | #{filename} | #{hint} | \n"
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
message
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def send_inline_comment(results, method)
|
|
75
|
+
dir = "#{Dir.pwd}/"
|
|
76
|
+
results.each do |r|
|
|
77
|
+
filename = r["file"].gsub(dir, "")
|
|
78
|
+
send(method, r["message"], file: filename, line: 0)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require File.expand_path("spec_helper", __dir__)
|
|
4
|
+
require_relative "../lib/iblinter/iblinter"
|
|
5
|
+
|
|
6
|
+
describe IBLinter do
|
|
7
|
+
it "command arguments works" do
|
|
8
|
+
binary_path = File.absolute_path "path/to/binary"
|
|
9
|
+
options = {}
|
|
10
|
+
cmd = "#{binary_path} lint --reporter json"
|
|
11
|
+
iblinter = IBLinter.new(binary_path)
|
|
12
|
+
expect(iblinter.lint_command(options)).to eq cmd
|
|
13
|
+
end
|
|
14
|
+
end
|
data/spec/plugin_spec.rb
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require File.expand_path("spec_helper", __dir__)
|
|
4
|
+
|
|
5
|
+
module Danger
|
|
6
|
+
describe Danger::DangerIBLinter do
|
|
7
|
+
it "should be a plugin" do
|
|
8
|
+
expect(Danger::DangerIBLinter.new(nil)).to be_a Danger::Plugin
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
describe "with Dangerfile" do
|
|
12
|
+
before do
|
|
13
|
+
@dangerfile = testing_dangerfile
|
|
14
|
+
@iblinter = @dangerfile.iblinter
|
|
15
|
+
|
|
16
|
+
# mock the PR data
|
|
17
|
+
# you can then use this, eg. github.pr_author, later in the spec
|
|
18
|
+
json = File.read(File.dirname(__FILE__) + "/support/fixtures/github_pr.json")
|
|
19
|
+
allow(@iblinter.github).to receive(:pr_json).and_return(json)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "inline comment works with relative path" do
|
|
23
|
+
linter = IBLinter.new("/path/to/binary")
|
|
24
|
+
allow(linter).to receive(:lint) do
|
|
25
|
+
JSON.parse(File.read(File.dirname(__FILE__) + "/support/fixtures/iblinter.json"))
|
|
26
|
+
end
|
|
27
|
+
allow(@iblinter).to receive(:iblinter).and_return(linter)
|
|
28
|
+
allow(Dir).to receive(:pwd).and_return("/home/projects")
|
|
29
|
+
allow(File).to receive(:exist?).and_return(true)
|
|
30
|
+
@iblinter.lint("/home/projects")
|
|
31
|
+
errors = [
|
|
32
|
+
Violation.new("Error message", false, "bar/File.xib", 0),
|
|
33
|
+
Violation.new("Failed due to IBLinter errors", false, nil, nil)
|
|
34
|
+
]
|
|
35
|
+
warnings = [
|
|
36
|
+
Violation.new("Warning message", false, "foo/File.xib", 0)
|
|
37
|
+
]
|
|
38
|
+
expect(@iblinter.violation_report[:errors]).to eq errors
|
|
39
|
+
expect(@iblinter.violation_report[:warnings]).to eq warnings
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "pathname"
|
|
4
|
+
ROOT = Pathname.new(File.expand_path("../", __dir__))
|
|
5
|
+
$:.unshift((ROOT + "lib").to_s)
|
|
6
|
+
$:.unshift((ROOT + "spec").to_s)
|
|
7
|
+
|
|
8
|
+
require "bundler/setup"
|
|
9
|
+
require "pry"
|
|
10
|
+
|
|
11
|
+
require "rspec"
|
|
12
|
+
require "danger"
|
|
13
|
+
|
|
14
|
+
if `git remote -v` == ""
|
|
15
|
+
puts "You cannot run tests without setting a local git remote on this repo"
|
|
16
|
+
puts "It's a weird side-effect of Danger's internals."
|
|
17
|
+
exit(0)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Use coloured output, it's the best.
|
|
21
|
+
RSpec.configure do |config|
|
|
22
|
+
config.filter_gems_from_backtrace "bundler"
|
|
23
|
+
config.color = true
|
|
24
|
+
config.tty = true
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
require "danger_plugin"
|
|
28
|
+
|
|
29
|
+
# These functions are a subset of https://github.com/danger/danger/blob/master/spec/spec_helper.rb
|
|
30
|
+
# If you are expanding these files, see if it's already been done ^.
|
|
31
|
+
|
|
32
|
+
# A silent version of the user interface,
|
|
33
|
+
# it comes with an extra function `.string` which will
|
|
34
|
+
# strip all ANSI colours from the string.
|
|
35
|
+
|
|
36
|
+
# rubocop:disable Lint/NestedMethodDefinition
|
|
37
|
+
def testing_ui
|
|
38
|
+
@output = StringIO.new
|
|
39
|
+
def @output.winsize
|
|
40
|
+
[20, 9999]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
cork = Cork::Board.new(out: @output)
|
|
44
|
+
def cork.string
|
|
45
|
+
out.string.gsub(/\e\[([;\d]+)?m/, "")
|
|
46
|
+
end
|
|
47
|
+
cork
|
|
48
|
+
end
|
|
49
|
+
# rubocop:enable Lint/NestedMethodDefinition
|
|
50
|
+
|
|
51
|
+
# Example environment (ENV) that would come from
|
|
52
|
+
# running a PR on TravisCI
|
|
53
|
+
def testing_env
|
|
54
|
+
{
|
|
55
|
+
"HAS_JOSH_K_SEAL_OF_APPROVAL" => "true",
|
|
56
|
+
"TRAVIS_PULL_REQUEST" => "800",
|
|
57
|
+
"TRAVIS_REPO_SLUG" => "artsy/eigen",
|
|
58
|
+
"TRAVIS_COMMIT_RANGE" => "759adcbd0d8f...13c4dc8bb61d",
|
|
59
|
+
"DANGER_GITHUB_API_TOKEN" => "123sbdq54erfsd3422gdfio"
|
|
60
|
+
}
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# A stubbed out Dangerfile for use in tests
|
|
64
|
+
def testing_dangerfile
|
|
65
|
+
env = Danger::EnvironmentManager.new(testing_env)
|
|
66
|
+
Danger::Dangerfile.new(env, testing_ui)
|
|
67
|
+
end
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{ "url": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18", "id": 185317229, "node_id": "MDExOlB1bGxSZXF1ZXN0MTg1MzE3MjI5", "html_url": "https://github.com/danger/danger-plugin-template/pull/18", "diff_url": "https://github.com/danger/danger-plugin-template/pull/18.diff", "patch_url": "https://github.com/danger/danger-plugin-template/pull/18.patch", "issue_url": "https://api.github.com/repos/danger/danger-plugin-template/issues/18", "number": 18, "state": "closed", "locked": false, "title": "add exmaple of how to mock PRs", "user": { "login": "wilrnh", "id": 555966, "node_id": "MDQ6VXNlcjU1NTk2Ng==", "avatar_url": "https://avatars2.githubusercontent.com/u/555966?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wilrnh", "html_url": "https://github.com/wilrnh", "followers_url": "https://api.github.com/users/wilrnh/followers", "following_url": "https://api.github.com/users/wilrnh/following{/other_user}", "gists_url": "https://api.github.com/users/wilrnh/gists{/gist_id}", "starred_url": "https://api.github.com/users/wilrnh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wilrnh/subscriptions", "organizations_url": "https://api.github.com/users/wilrnh/orgs", "repos_url": "https://api.github.com/users/wilrnh/repos", "events_url": "https://api.github.com/users/wilrnh/events{/privacy}", "received_events_url": "https://api.github.com/users/wilrnh/received_events", "type": "User", "site_admin": false }, "body": "Fixes danger/danger#661
|
|
2
|
+
|
|
3
|
+
add example how to mock PRs", "created_at": "2018-05-02T01:52:26Z", "updated_at": "2018-05-02T10:37:04Z", "closed_at": "2018-05-02T10:37:04Z", "merged_at": "2018-05-02T10:37:04Z", "merge_commit_sha": "39eacac22d52a2b70fc49bd8aba19eb7d2864717", "assignee": null, "assignees": [ ], "requested_reviewers": [ ], "requested_teams": [ ], "labels": [ ], "milestone": null, "commits_url": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18/commits", "review_comments_url": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18/comments", "review_comment_url": "https://api.github.com/repos/danger/danger-plugin-template/pulls/comments{/number}", "comments_url": "https://api.github.com/repos/danger/danger-plugin-template/issues/18/comments", "statuses_url": "https://api.github.com/repos/danger/danger-plugin-template/statuses/abe89bee0cdc5f45b1dee62c60e74c70f3fcb5d5", "head": { "label": "wilrnh:661-mocking-prs", "ref": "661-mocking-prs", "sha": "abe89bee0cdc5f45b1dee62c60e74c70f3fcb5d5", "user": { "login": "wilrnh", "id": 555966, "node_id": "MDQ6VXNlcjU1NTk2Ng==", "avatar_url": "https://avatars2.githubusercontent.com/u/555966?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wilrnh", "html_url": "https://github.com/wilrnh", "followers_url": "https://api.github.com/users/wilrnh/followers", "following_url": "https://api.github.com/users/wilrnh/following{/other_user}", "gists_url": "https://api.github.com/users/wilrnh/gists{/gist_id}", "starred_url": "https://api.github.com/users/wilrnh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wilrnh/subscriptions", "organizations_url": "https://api.github.com/users/wilrnh/orgs", "repos_url": "https://api.github.com/users/wilrnh/repos", "events_url": "https://api.github.com/users/wilrnh/events{/privacy}", "received_events_url": "https://api.github.com/users/wilrnh/received_events", "type": "User", "site_admin": false }, "repo": { "id": 131783880, "node_id": "MDEwOlJlcG9zaXRvcnkxMzE3ODM4ODA=", "name": "danger-plugin-template", "full_name": "wilrnh/danger-plugin-template", "private": false, "owner": { "login": "wilrnh", "id": 555966, "node_id": "MDQ6VXNlcjU1NTk2Ng==", "avatar_url": "https://avatars2.githubusercontent.com/u/555966?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wilrnh", "html_url": "https://github.com/wilrnh", "followers_url": "https://api.github.com/users/wilrnh/followers", "following_url": "https://api.github.com/users/wilrnh/following{/other_user}", "gists_url": "https://api.github.com/users/wilrnh/gists{/gist_id}", "starred_url": "https://api.github.com/users/wilrnh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wilrnh/subscriptions", "organizations_url": "https://api.github.com/users/wilrnh/orgs", "repos_url": "https://api.github.com/users/wilrnh/repos", "events_url": "https://api.github.com/users/wilrnh/events{/privacy}", "received_events_url": "https://api.github.com/users/wilrnh/received_events", "type": "User", "site_admin": false }, "html_url": "https://github.com/wilrnh/danger-plugin-template", "description": "An opinionated template for creating a Danger plugin", "fork": true, "url": "https://api.github.com/repos/wilrnh/danger-plugin-template", "forks_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/forks", "keys_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/keys{/key_id}", "collaborators_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/collaborators{/collaborator}", "teams_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/teams", "hooks_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/hooks", "issue_events_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/issues/events{/number}", "events_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/events", "assignees_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/assignees{/user}", "branches_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/branches{/branch}", "tags_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/tags", "blobs_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/git/blobs{/sha}", "git_tags_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/git/tags{/sha}", "git_refs_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/git/refs{/sha}", "trees_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/git/trees{/sha}", "statuses_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/statuses/{sha}", "languages_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/languages", "stargazers_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/stargazers", "contributors_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/contributors", "subscribers_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/subscribers", "subscription_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/subscription", "commits_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/commits{/sha}", "git_commits_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/git/commits{/sha}", "comments_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/comments{/number}", "issue_comment_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/issues/comments{/number}", "contents_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/contents/{+path}", "compare_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/compare/{base}...{head}", "merges_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/merges", "archive_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/{archive_format}{/ref}", "downloads_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/downloads", "issues_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/issues{/number}", "pulls_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/pulls{/number}", "milestones_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/milestones{/number}", "notifications_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/notifications{?since,all,participating}", "labels_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/labels{/name}", "releases_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/releases{/id}", "deployments_url": "https://api.github.com/repos/wilrnh/danger-plugin-template/deployments", "created_at": "2018-05-02T01:50:31Z", "updated_at": "2018-05-02T01:50:32Z", "pushed_at": "2018-05-02T02:04:13Z", "git_url": "git://github.com/wilrnh/danger-plugin-template.git", "ssh_url": "git@github.com:wilrnh/danger-plugin-template.git", "clone_url": "https://github.com/wilrnh/danger-plugin-template.git", "svn_url": "https://github.com/wilrnh/danger-plugin-template", "homepage": null, "size": 32, "stargazers_count": 0, "watchers_count": 0, "language": "Ruby", "has_issues": false, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": false, "forks_count": 0, "mirror_url": null, "archived": false, "open_issues_count": 0, "license": { "key": "other", "name": "Other", "spdx_id": "NOASSERTION", "url": null, "node_id": "MDc6TGljZW5zZTA=" }, "forks": 0, "open_issues": 0, "watchers": 0, "default_branch": "master" } }, "base": { "label": "danger:master", "ref": "master", "sha": "30bd69c1c09d927abde0695fcb39dd70d4cc0f81", "user": { "login": "danger", "id": 17147106, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE3MTQ3MTA2", "avatar_url": "https://avatars3.githubusercontent.com/u/17147106?v=4", "gravatar_id": "", "url": "https://api.github.com/users/danger", "html_url": "https://github.com/danger", "followers_url": "https://api.github.com/users/danger/followers", "following_url": "https://api.github.com/users/danger/following{/other_user}", "gists_url": "https://api.github.com/users/danger/gists{/gist_id}", "starred_url": "https://api.github.com/users/danger/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/danger/subscriptions", "organizations_url": "https://api.github.com/users/danger/orgs", "repos_url": "https://api.github.com/users/danger/repos", "events_url": "https://api.github.com/users/danger/events{/privacy}", "received_events_url": "https://api.github.com/users/danger/received_events", "type": "Organization", "site_admin": false }, "repo": { "id": 60424063, "node_id": "MDEwOlJlcG9zaXRvcnk2MDQyNDA2Mw==", "name": "danger-plugin-template", "full_name": "danger/danger-plugin-template", "private": false, "owner": { "login": "danger", "id": 17147106, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE3MTQ3MTA2", "avatar_url": "https://avatars3.githubusercontent.com/u/17147106?v=4", "gravatar_id": "", "url": "https://api.github.com/users/danger", "html_url": "https://github.com/danger", "followers_url": "https://api.github.com/users/danger/followers", "following_url": "https://api.github.com/users/danger/following{/other_user}", "gists_url": "https://api.github.com/users/danger/gists{/gist_id}", "starred_url": "https://api.github.com/users/danger/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/danger/subscriptions", "organizations_url": "https://api.github.com/users/danger/orgs", "repos_url": "https://api.github.com/users/danger/repos", "events_url": "https://api.github.com/users/danger/events{/privacy}", "received_events_url": "https://api.github.com/users/danger/received_events", "type": "Organization", "site_admin": false }, "html_url": "https://github.com/danger/danger-plugin-template", "description": "An opinionated template for creating a Danger plugin", "fork": false, "url": "https://api.github.com/repos/danger/danger-plugin-template", "forks_url": "https://api.github.com/repos/danger/danger-plugin-template/forks", "keys_url": "https://api.github.com/repos/danger/danger-plugin-template/keys{/key_id}", "collaborators_url": "https://api.github.com/repos/danger/danger-plugin-template/collaborators{/collaborator}", "teams_url": "https://api.github.com/repos/danger/danger-plugin-template/teams", "hooks_url": "https://api.github.com/repos/danger/danger-plugin-template/hooks", "issue_events_url": "https://api.github.com/repos/danger/danger-plugin-template/issues/events{/number}", "events_url": "https://api.github.com/repos/danger/danger-plugin-template/events", "assignees_url": "https://api.github.com/repos/danger/danger-plugin-template/assignees{/user}", "branches_url": "https://api.github.com/repos/danger/danger-plugin-template/branches{/branch}", "tags_url": "https://api.github.com/repos/danger/danger-plugin-template/tags", "blobs_url": "https://api.github.com/repos/danger/danger-plugin-template/git/blobs{/sha}", "git_tags_url": "https://api.github.com/repos/danger/danger-plugin-template/git/tags{/sha}", "git_refs_url": "https://api.github.com/repos/danger/danger-plugin-template/git/refs{/sha}", "trees_url": "https://api.github.com/repos/danger/danger-plugin-template/git/trees{/sha}", "statuses_url": "https://api.github.com/repos/danger/danger-plugin-template/statuses/{sha}", "languages_url": "https://api.github.com/repos/danger/danger-plugin-template/languages", "stargazers_url": "https://api.github.com/repos/danger/danger-plugin-template/stargazers", "contributors_url": "https://api.github.com/repos/danger/danger-plugin-template/contributors", "subscribers_url": "https://api.github.com/repos/danger/danger-plugin-template/subscribers", "subscription_url": "https://api.github.com/repos/danger/danger-plugin-template/subscription", "commits_url": "https://api.github.com/repos/danger/danger-plugin-template/commits{/sha}", "git_commits_url": "https://api.github.com/repos/danger/danger-plugin-template/git/commits{/sha}", "comments_url": "https://api.github.com/repos/danger/danger-plugin-template/comments{/number}", "issue_comment_url": "https://api.github.com/repos/danger/danger-plugin-template/issues/comments{/number}", "contents_url": "https://api.github.com/repos/danger/danger-plugin-template/contents/{+path}", "compare_url": "https://api.github.com/repos/danger/danger-plugin-template/compare/{base}...{head}", "merges_url": "https://api.github.com/repos/danger/danger-plugin-template/merges", "archive_url": "https://api.github.com/repos/danger/danger-plugin-template/{archive_format}{/ref}", "downloads_url": "https://api.github.com/repos/danger/danger-plugin-template/downloads", "issues_url": "https://api.github.com/repos/danger/danger-plugin-template/issues{/number}", "pulls_url": "https://api.github.com/repos/danger/danger-plugin-template/pulls{/number}", "milestones_url": "https://api.github.com/repos/danger/danger-plugin-template/milestones{/number}", "notifications_url": "https://api.github.com/repos/danger/danger-plugin-template/notifications{?since,all,participating}", "labels_url": "https://api.github.com/repos/danger/danger-plugin-template/labels{/name}", "releases_url": "https://api.github.com/repos/danger/danger-plugin-template/releases{/id}", "deployments_url": "https://api.github.com/repos/danger/danger-plugin-template/deployments", "created_at": "2016-06-04T18:17:02Z", "updated_at": "2018-07-25T10:13:25Z", "pushed_at": "2018-05-02T10:37:04Z", "git_url": "git://github.com/danger/danger-plugin-template.git", "ssh_url": "git@github.com:danger/danger-plugin-template.git", "clone_url": "https://github.com/danger/danger-plugin-template.git", "svn_url": "https://github.com/danger/danger-plugin-template", "homepage": null, "size": 33, "stargazers_count": 11, "watchers_count": 11, "language": "Ruby", "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": false, "forks_count": 9, "mirror_url": null, "archived": false, "open_issues_count": 2, "license": { "key": "other", "name": "Other", "spdx_id": "NOASSERTION", "url": null, "node_id": "MDc6TGljZW5zZTA=" }, "forks": 9, "open_issues": 2, "watchers": 11, "default_branch": "master" } }, "_links": { "self": { "href": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18" }, "html": { "href": "https://github.com/danger/danger-plugin-template/pull/18" }, "issue": { "href": "https://api.github.com/repos/danger/danger-plugin-template/issues/18" }, "comments": { "href": "https://api.github.com/repos/danger/danger-plugin-template/issues/18/comments" }, "review_comments": { "href": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18/comments" }, "review_comment": { "href": "https://api.github.com/repos/danger/danger-plugin-template/pulls/comments{/number}" }, "commits": { "href": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18/commits" }, "statuses": { "href": "https://api.github.com/repos/danger/danger-plugin-template/statuses/abe89bee0cdc5f45b1dee62c60e74c70f3fcb5d5" } }, "author_association": "CONTRIBUTOR", "merged": true, "mergeable": null, "rebaseable": null, "mergeable_state": "unknown", "merged_by": { "login": "orta", "id": 49038, "node_id": "MDQ6VXNlcjQ5MDM4", "avatar_url": "https://avatars2.githubusercontent.com/u/49038?v=4", "gravatar_id": "", "url": "https://api.github.com/users/orta", "html_url": "https://github.com/orta", "followers_url": "https://api.github.com/users/orta/followers", "following_url": "https://api.github.com/users/orta/following{/other_user}", "gists_url": "https://api.github.com/users/orta/gists{/gist_id}", "starred_url": "https://api.github.com/users/orta/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/orta/subscriptions", "organizations_url": "https://api.github.com/users/orta/orgs", "repos_url": "https://api.github.com/users/orta/repos", "events_url": "https://api.github.com/users/orta/events{/privacy}", "received_events_url": "https://api.github.com/users/orta/received_events", "type": "User", "site_admin": false }, "comments": 2, "review_comments": 0, "maintainer_can_modify": false, "commits": 2, "additions": 5, "deletions": 0, "changed_files": 1 }
|
metadata
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: danger-iblinter
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Yuta Saito
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2019-01-22 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: danger-plugin-api
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: bundler
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.3'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.3'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rake
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '10.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '10.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rspec
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '3.4'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '3.4'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rubocop
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: yard
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: guard
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '2.14'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '2.14'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: guard-rspec
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - "~>"
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '4.7'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - "~>"
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '4.7'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: listen
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - '='
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: 3.0.7
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - '='
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: 3.0.7
|
|
139
|
+
- !ruby/object:Gem::Dependency
|
|
140
|
+
name: pry
|
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
|
142
|
+
requirements:
|
|
143
|
+
- - ">="
|
|
144
|
+
- !ruby/object:Gem::Version
|
|
145
|
+
version: '0'
|
|
146
|
+
type: :development
|
|
147
|
+
prerelease: false
|
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
149
|
+
requirements:
|
|
150
|
+
- - ">="
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: '0'
|
|
153
|
+
description: A danger plugin for linting Interface Builder files with IBLinter.
|
|
154
|
+
email:
|
|
155
|
+
- kateinoigakukun@gmail.com
|
|
156
|
+
executables: []
|
|
157
|
+
extensions: []
|
|
158
|
+
extra_rdoc_files: []
|
|
159
|
+
files:
|
|
160
|
+
- ".gitignore"
|
|
161
|
+
- ".rubocop.yml"
|
|
162
|
+
- ".travis.yml"
|
|
163
|
+
- Gemfile
|
|
164
|
+
- Gemfile.lock
|
|
165
|
+
- Guardfile
|
|
166
|
+
- LICENSE.txt
|
|
167
|
+
- README.md
|
|
168
|
+
- Rakefile
|
|
169
|
+
- danger-iblinter.gemspec
|
|
170
|
+
- lib/danger_iblinter.rb
|
|
171
|
+
- lib/danger_plugin.rb
|
|
172
|
+
- lib/iblinter/gem_version.rb
|
|
173
|
+
- lib/iblinter/iblinter.rb
|
|
174
|
+
- lib/iblinter/plugin.rb
|
|
175
|
+
- spec/iblinter_spec.rb
|
|
176
|
+
- spec/plugin_spec.rb
|
|
177
|
+
- spec/spec_helper.rb
|
|
178
|
+
- spec/support/fixtures/github_pr.json
|
|
179
|
+
- spec/support/fixtures/iblinter.json
|
|
180
|
+
homepage: https://github.com/IBDecodable/danger-ruby-iblinter
|
|
181
|
+
licenses:
|
|
182
|
+
- MIT
|
|
183
|
+
metadata: {}
|
|
184
|
+
post_install_message:
|
|
185
|
+
rdoc_options: []
|
|
186
|
+
require_paths:
|
|
187
|
+
- lib
|
|
188
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
189
|
+
requirements:
|
|
190
|
+
- - ">="
|
|
191
|
+
- !ruby/object:Gem::Version
|
|
192
|
+
version: '0'
|
|
193
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
|
+
requirements:
|
|
195
|
+
- - ">="
|
|
196
|
+
- !ruby/object:Gem::Version
|
|
197
|
+
version: '0'
|
|
198
|
+
requirements: []
|
|
199
|
+
rubyforge_project:
|
|
200
|
+
rubygems_version: 2.7.5
|
|
201
|
+
signing_key:
|
|
202
|
+
specification_version: 4
|
|
203
|
+
summary: A danger plugin for linting Interface Builder files with IBLinter.
|
|
204
|
+
test_files:
|
|
205
|
+
- spec/iblinter_spec.rb
|
|
206
|
+
- spec/plugin_spec.rb
|
|
207
|
+
- spec/spec_helper.rb
|
|
208
|
+
- spec/support/fixtures/github_pr.json
|
|
209
|
+
- spec/support/fixtures/iblinter.json
|