rubocop-cask 0.21.0 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/lib/rubocop/cask/ast/cask_block.rb +1 -0
- data/lib/rubocop/cask/version.rb +1 -1
- data/lib/rubocop/cop/cask/homepage_matches_url.rb +2 -0
- data/lib/rubocop/cop/cask/homepage_url_trailing_slash.rb +1 -0
- data/lib/rubocop/cop/cask/no_dsl_version.rb +1 -0
- data/lib/rubocop/cop/cask/stanza_grouping.rb +1 -0
- data/spec/rubocop/cask_spec.rb +37 -0
- data/spec/rubocop/cop/cask/homepage_matches_url_spec.rb +137 -141
- data/spec/rubocop/cop/cask/homepage_url_trailing_slash_spec.rb +38 -40
- data/spec/rubocop/cop/cask/stanza_grouping_spec.rb +1 -0
- data/spec/spec_helper.rb +4 -3
- metadata +28 -8
- data/spec/project_spec.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22d2072108140f809e919c9f1bfe3c9a7fbf095c5d16b2db1a5eb1c1ac2f5db5
|
4
|
+
data.tar.gz: db42b732f5139900a29cc9d461f7c405ae861fd515b280a6b517d772985cf313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cedcd755c015b5cdcd97245f8c7c4feef9e51d24cdacc0a033376facea45a83b8f83b0be53cfb23a851b6183f5fcabbc7a87c9d952a6d9cb37ed186b312dfb3
|
7
|
+
data.tar.gz: b99489754639d326f3d3fcc3323301a26d75e55b76e07d83ab88f6f8d9aaa5b6a44bc6073cea2c2f933681d9c4241b2fecb9e99cba6a6ac226608d6ce397a1c3
|
data/README.md
CHANGED
@@ -66,21 +66,21 @@ Cask/NoDslVersion:
|
|
66
66
|
|
67
67
|
## Contributing
|
68
68
|
|
69
|
-
1. Fork it
|
70
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
71
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
72
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
73
|
-
5. Create new
|
69
|
+
1. Fork it.
|
70
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
71
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
72
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
73
|
+
5. Create new pull request.
|
74
74
|
|
75
75
|
|
76
76
|
## Maintaining
|
77
77
|
|
78
78
|
To publish a new release:
|
79
79
|
|
80
|
-
1.
|
81
|
-
2.
|
82
|
-
3.
|
83
|
-
4.
|
80
|
+
1. Update the version in `lib/rubocop/cask/version.rb`.
|
81
|
+
2. Run `bundle exec rake build` to run tests and generate the changelog.
|
82
|
+
3. Commit the changes.
|
83
|
+
4. Create a new tag on GitHub.
|
84
84
|
|
85
85
|
|
86
86
|
## License
|
data/lib/rubocop/cask/version.rb
CHANGED
@@ -30,6 +30,7 @@ module RuboCop
|
|
30
30
|
def on_cask(cask_block)
|
31
31
|
@cask_block = cask_block
|
32
32
|
return unless homepage_stanza
|
33
|
+
|
33
34
|
add_offenses
|
34
35
|
end
|
35
36
|
|
@@ -122,6 +123,7 @@ module RuboCop
|
|
122
123
|
def extract_url(stanza)
|
123
124
|
string = stanza.stanza_node.children[2]
|
124
125
|
return string.str_content if string.str_type?
|
126
|
+
|
125
127
|
string.to_s.gsub(%r{.*"([a-z0-9]+\:\/\/[^"]+)".*}m, '\1')
|
126
128
|
end
|
127
129
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
describe RuboCop::Cask do
|
2
|
+
describe 'the default configuration file' do
|
3
|
+
subject(:default_config) {
|
4
|
+
RuboCop::ConfigLoader.load_file('config/default.yml')
|
5
|
+
}
|
6
|
+
|
7
|
+
let(:cop_names) {
|
8
|
+
cop_files = Dir.glob(File.join(__dir__, '..', '..', 'lib',
|
9
|
+
'rubocop', 'cop', 'cask', '*.rb'))
|
10
|
+
cop_files.map { |file|
|
11
|
+
cop_name = File.basename(file, '.rb')
|
12
|
+
.gsub(/(^|_)(.)/) { Regexp.last_match(2).upcase }
|
13
|
+
|
14
|
+
"Cask/#{cop_name}"
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
let(:cask_config_keys) {
|
19
|
+
default_config.keys.select { |k| k.start_with?('Cask/') }
|
20
|
+
}
|
21
|
+
|
22
|
+
it 'includes all cops' do
|
23
|
+
expect(cask_config_keys.sort).to eq(cop_names.sort)
|
24
|
+
end
|
25
|
+
|
26
|
+
matcher :have_a_description do
|
27
|
+
match do |cop_name|
|
28
|
+
expect(default_config[cop_name]['Description']).not_to be nil
|
29
|
+
expect(default_config[cop_name]['Description']).not_to include("\n")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'has a nicely formatted description for all cops' do
|
34
|
+
expect(cop_names).to all have_a_description
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -3,176 +3,172 @@ describe RuboCop::Cop::Cask::HomepageMatchesUrl do
|
|
3
3
|
|
4
4
|
subject(:cop) { described_class.new }
|
5
5
|
|
6
|
-
context 'when the url matches the homepage' do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
CASK
|
15
|
-
end
|
16
|
-
|
17
|
-
include_examples 'does not report any offenses'
|
6
|
+
context 'when the url matches the homepage and there is no comment' do
|
7
|
+
let(:source) do
|
8
|
+
<<-CASK.undent
|
9
|
+
cask 'foo' do
|
10
|
+
url 'https://foo.example.com/foo.zip'
|
11
|
+
homepage 'https://foo.example.com'
|
12
|
+
end
|
13
|
+
CASK
|
18
14
|
end
|
19
15
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
16
|
+
include_examples 'does not report any offenses'
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'when the url matches the homepage and the url stanza has ' \
|
20
|
+
'a referrer and no interpolation' do
|
21
|
+
let(:source) do
|
22
|
+
<<-CASK.undent
|
23
|
+
cask 'foo' do
|
24
|
+
url 'https://foo.example.com/foo.zip',
|
25
|
+
referrer: 'https://example.com/foo/'
|
26
|
+
homepage 'https://foo.example.com'
|
30
27
|
end
|
28
|
+
CASK
|
29
|
+
end
|
31
30
|
|
32
|
-
|
33
|
-
|
31
|
+
include_examples 'does not report any offenses'
|
32
|
+
end
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
CASK
|
34
|
+
context 'when the url matches the homepage and the url stanza has ' \
|
35
|
+
'a referrer and interpolation' do
|
36
|
+
let(:source) do
|
37
|
+
<<-CASK.undent
|
38
|
+
cask 'foo' do
|
39
|
+
version '1.8.0_72,8.13.0.5'
|
40
|
+
url "https://foo.example.com/foo-\#{version.after_comma}-\#{version.minor}.\#{version.patch}.\#{version.before_comma.sub(\%r{.*_}, '')}.zip",
|
41
|
+
referrer: 'https://example.com/foo/'
|
42
|
+
homepage 'https://foo.example.com'
|
45
43
|
end
|
46
|
-
|
47
|
-
include_examples 'does not report any offenses'
|
48
|
-
end
|
44
|
+
CASK
|
49
45
|
end
|
50
46
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
47
|
+
include_examples 'does not report any offenses'
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'when the url matches the homepage but there is a comment ' \
|
51
|
+
'which does not match the url' do
|
52
|
+
let(:source) do
|
53
|
+
<<-CASK.undent
|
54
|
+
cask 'foo' do
|
55
|
+
# this is just a comment with information
|
56
|
+
url 'https://example.com/foo.zip'
|
57
|
+
homepage 'https://example.com'
|
61
58
|
end
|
59
|
+
CASK
|
60
|
+
end
|
62
61
|
|
63
|
-
|
64
|
-
|
62
|
+
include_examples 'does not report any offenses'
|
63
|
+
end
|
65
64
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
CASK
|
75
|
-
end
|
76
|
-
let(:expected_offenses) do
|
77
|
-
[{
|
78
|
-
message: '`foo.example.com` matches `example.com`, ' \
|
79
|
-
'the comment above the `url` stanza is unnecessary',
|
80
|
-
severity: :convention,
|
81
|
-
line: 2,
|
82
|
-
column: 2,
|
83
|
-
source: '# foo.example.com was verified as official when ' \
|
84
|
-
'first introduced to the cask'
|
85
|
-
}]
|
65
|
+
context 'when the url matches the homepage ' \
|
66
|
+
'but there is a comment matching the url' do
|
67
|
+
let(:source) do
|
68
|
+
<<-CASK.undent
|
69
|
+
cask 'foo' do
|
70
|
+
# foo.example.com was verified as official when first introduced to the cask
|
71
|
+
url 'https://foo.example.com/foo.zip'
|
72
|
+
homepage 'https://foo.example.com'
|
86
73
|
end
|
87
|
-
|
88
|
-
|
89
|
-
|
74
|
+
CASK
|
75
|
+
end
|
76
|
+
let(:expected_offenses) do
|
77
|
+
[{
|
78
|
+
message: '`foo.example.com` matches `example.com`, ' \
|
79
|
+
'the comment above the `url` stanza is unnecessary',
|
80
|
+
severity: :convention,
|
81
|
+
line: 2,
|
82
|
+
column: 2,
|
83
|
+
source: '# foo.example.com was verified as official when ' \
|
84
|
+
'first introduced to the cask'
|
85
|
+
}]
|
90
86
|
end
|
87
|
+
|
88
|
+
include_examples 'reports offenses'
|
91
89
|
end
|
92
90
|
|
93
91
|
context 'when the url does not match the homepage' do
|
94
|
-
context '
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
homepage 'https://foo.example.org'
|
103
|
-
end
|
104
|
-
CASK
|
105
|
-
end
|
106
|
-
let(:expected_offenses) do
|
107
|
-
[{
|
108
|
-
message: '`# example.com was verified as official` does not ' \
|
109
|
-
'match the expected comment format. For details, see ' \
|
110
|
-
'https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-a-comment',
|
111
|
-
severity: :convention,
|
112
|
-
line: 2,
|
113
|
-
column: 2,
|
114
|
-
source: '# example.com was verified as official'
|
115
|
-
}]
|
92
|
+
context 'when there is a comment matching the url ' \
|
93
|
+
'but not matching the expected format' do
|
94
|
+
let(:source) do
|
95
|
+
<<-CASK.undent
|
96
|
+
cask 'foo' do
|
97
|
+
# example.com was verified as official
|
98
|
+
url 'https://example.com/foo.zip'
|
99
|
+
homepage 'https://foo.example.org'
|
116
100
|
end
|
101
|
+
CASK
|
102
|
+
end
|
103
|
+
let(:expected_offenses) do
|
104
|
+
[{
|
105
|
+
message: '`# example.com was verified as official` does not ' \
|
106
|
+
'match the expected comment format. For details, see ' \
|
107
|
+
'https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-a-comment',
|
108
|
+
severity: :convention,
|
109
|
+
line: 2,
|
110
|
+
column: 2,
|
111
|
+
source: '# example.com was verified as official'
|
112
|
+
}]
|
113
|
+
end
|
117
114
|
|
118
|
-
|
119
|
-
|
115
|
+
include_examples 'reports offenses'
|
116
|
+
end
|
120
117
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
CASK
|
118
|
+
context 'when there is a comment matching the url ' \
|
119
|
+
'and does not have slashes' do
|
120
|
+
let(:source) do
|
121
|
+
<<-CASK.undent
|
122
|
+
cask 'foo' do
|
123
|
+
# example.com was verified as official when first introduced to the cask
|
124
|
+
url 'https://example.com/foo.zip'
|
125
|
+
homepage 'https://foo.example.org'
|
130
126
|
end
|
127
|
+
CASK
|
128
|
+
end
|
131
129
|
|
132
|
-
|
133
|
-
|
130
|
+
include_examples 'does not report any offenses'
|
131
|
+
end
|
134
132
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
end
|
143
|
-
CASK
|
133
|
+
context 'when there is a comment matching the url and has slashes' do
|
134
|
+
let(:source) do
|
135
|
+
<<-CASK.undent
|
136
|
+
cask 'foo' do
|
137
|
+
# example.com/vendor/app was verified as official when first introduced to the cask
|
138
|
+
url 'https://downloads.example.com/vendor/app/foo.zip'
|
139
|
+
homepage 'https://vendor.example.org/app/'
|
144
140
|
end
|
145
|
-
|
146
|
-
include_examples 'does not report any offenses'
|
147
|
-
end
|
141
|
+
CASK
|
148
142
|
end
|
149
143
|
|
150
|
-
|
151
|
-
|
152
|
-
<<-CASK.undent
|
153
|
-
cask 'foo' do
|
154
|
-
# example.com was verified as official when first introduced to the cask
|
155
|
-
url 'https://example.org/foo.zip'
|
156
|
-
homepage 'https://foo.example.com'
|
157
|
-
end
|
158
|
-
CASK
|
159
|
-
end
|
160
|
-
let(:expected_offenses) do
|
161
|
-
[{
|
162
|
-
message: '`example.com` does not match `example.org/foo.zip`',
|
163
|
-
severity: :convention,
|
164
|
-
line: 2,
|
165
|
-
column: 2,
|
166
|
-
source: '# example.com was verified as official when ' \
|
167
|
-
'first introduced to the cask'
|
168
|
-
}]
|
169
|
-
end
|
144
|
+
include_examples 'does not report any offenses'
|
145
|
+
end
|
170
146
|
|
171
|
-
|
147
|
+
context 'when there is a comment which does not match the url' do
|
148
|
+
let(:source) do
|
149
|
+
<<-CASK.undent
|
150
|
+
cask 'foo' do
|
151
|
+
# example.com was verified as official when first introduced to the cask
|
152
|
+
url 'https://example.org/foo.zip'
|
153
|
+
homepage 'https://foo.example.com'
|
154
|
+
end
|
155
|
+
CASK
|
156
|
+
end
|
157
|
+
let(:expected_offenses) do
|
158
|
+
[{
|
159
|
+
message: '`example.com` does not match `example.org/foo.zip`',
|
160
|
+
severity: :convention,
|
161
|
+
line: 2,
|
162
|
+
column: 2,
|
163
|
+
source: '# example.com was verified as official when ' \
|
164
|
+
'first introduced to the cask'
|
165
|
+
}]
|
172
166
|
end
|
167
|
+
|
168
|
+
include_examples 'reports offenses'
|
173
169
|
end
|
174
170
|
|
175
|
-
context '
|
171
|
+
context 'when the comment is missing' do
|
176
172
|
let(:source) do
|
177
173
|
<<-CASK.undent
|
178
174
|
cask 'foo' do
|
@@ -15,48 +15,46 @@ describe RuboCop::Cop::Cask::HomepageUrlTrailingSlash do
|
|
15
15
|
include_examples 'does not report any offenses'
|
16
16
|
end
|
17
17
|
|
18
|
-
context 'when the homepage url does not end with a slash' do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
CASK
|
26
|
-
end
|
27
|
-
|
28
|
-
include_examples 'does not report any offenses'
|
18
|
+
context 'when the homepage url does not end with a slash but has a path' do
|
19
|
+
let(:source) do
|
20
|
+
<<-CASK.undent
|
21
|
+
cask 'foo' do
|
22
|
+
homepage 'https://foo.example.com/path'
|
23
|
+
end
|
24
|
+
CASK
|
29
25
|
end
|
30
26
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
cask 'foo' do
|
42
|
-
homepage 'https://foo.example.com/'
|
43
|
-
end
|
44
|
-
CASK
|
45
|
-
end
|
46
|
-
let(:expected_offenses) do
|
47
|
-
[{
|
48
|
-
message: "'https://foo.example.com' must have a slash "\
|
49
|
-
'after the domain.',
|
50
|
-
severity: :convention,
|
51
|
-
line: 2,
|
52
|
-
column: 11,
|
53
|
-
source: "'https://foo.example.com'"
|
54
|
-
}]
|
55
|
-
end
|
56
|
-
|
57
|
-
include_examples 'reports offenses'
|
58
|
-
|
59
|
-
include_examples 'autocorrects source'
|
27
|
+
include_examples 'does not report any offenses'
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'when the homepage url does not end with a slash and has no path' do
|
31
|
+
let(:source) do
|
32
|
+
<<-CASK.undent
|
33
|
+
cask 'foo' do
|
34
|
+
homepage 'https://foo.example.com'
|
35
|
+
end
|
36
|
+
CASK
|
60
37
|
end
|
38
|
+
let(:correct_source) do
|
39
|
+
<<-CASK.undent
|
40
|
+
cask 'foo' do
|
41
|
+
homepage 'https://foo.example.com/'
|
42
|
+
end
|
43
|
+
CASK
|
44
|
+
end
|
45
|
+
let(:expected_offenses) do
|
46
|
+
[{
|
47
|
+
message: "'https://foo.example.com' must have a slash "\
|
48
|
+
'after the domain.',
|
49
|
+
severity: :convention,
|
50
|
+
line: 2,
|
51
|
+
column: 11,
|
52
|
+
source: "'https://foo.example.com'"
|
53
|
+
}]
|
54
|
+
end
|
55
|
+
|
56
|
+
include_examples 'reports offenses'
|
57
|
+
|
58
|
+
include_examples 'autocorrects source'
|
61
59
|
end
|
62
60
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -7,7 +7,9 @@ if ENV['COVERAGE']
|
|
7
7
|
end
|
8
8
|
|
9
9
|
project_path = File.join(File.dirname(__FILE__), '..')
|
10
|
-
Dir["#{project_path}/spec/support/**/*.rb"].each
|
10
|
+
Dir["#{project_path}/spec/support/**/*.rb"].each do |f|
|
11
|
+
require f
|
12
|
+
end
|
11
13
|
|
12
14
|
RSpec.configure do |config|
|
13
15
|
config.order = :random
|
@@ -21,6 +23,5 @@ RSpec.configure do |config|
|
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
|
-
$LOAD_PATH.unshift(File.join(
|
25
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
26
|
+
$LOAD_PATH.unshift(File.join(__dir__, '..', 'lib'))
|
26
27
|
require 'rubocop-cask'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-cask
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Hagins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: public_suffix
|
@@ -16,28 +16,34 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0
|
19
|
+
version: '3.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.0.3
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.0
|
29
|
+
version: '3.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.0.3
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rubocop
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
39
|
+
version: 0.59.1
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
46
|
+
version: 0.59.1
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: bundler
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +58,20 @@ dependencies:
|
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '1.16'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rubocop-rspec
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
55
75
|
description: |2
|
56
76
|
Code style checking for Homebrew-Cask files.
|
57
77
|
A plugin for the RuboCop code style enforcing & linting tool.
|
@@ -81,7 +101,7 @@ files:
|
|
81
101
|
- lib/rubocop/cop/cask/no_dsl_version.rb
|
82
102
|
- lib/rubocop/cop/cask/stanza_grouping.rb
|
83
103
|
- lib/rubocop/cop/cask/stanza_order.rb
|
84
|
-
- spec/
|
104
|
+
- spec/rubocop/cask_spec.rb
|
85
105
|
- spec/rubocop/cop/cask/homepage_matches_url_spec.rb
|
86
106
|
- spec/rubocop/cop/cask/homepage_url_trailing_slash_spec.rb
|
87
107
|
- spec/rubocop/cop/cask/no_dsl_version_spec.rb
|
@@ -114,7 +134,7 @@ signing_key:
|
|
114
134
|
specification_version: 4
|
115
135
|
summary: Code style checking for Homebrew-Cask files
|
116
136
|
test_files:
|
117
|
-
- spec/
|
137
|
+
- spec/rubocop/cask_spec.rb
|
118
138
|
- spec/rubocop/cop/cask/homepage_matches_url_spec.rb
|
119
139
|
- spec/rubocop/cop/cask/homepage_url_trailing_slash_spec.rb
|
120
140
|
- spec/rubocop/cop/cask/no_dsl_version_spec.rb
|
data/spec/project_spec.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
describe 'RuboCop Project' do
|
2
|
-
describe 'default configuration file' do
|
3
|
-
let(:cop_names) do
|
4
|
-
cop_files = Dir.glob(File.join(File.dirname(__FILE__), '..', 'lib',
|
5
|
-
'rubocop', 'cop', 'cask', '*.rb'))
|
6
|
-
cop_files.map do |file|
|
7
|
-
cop_name = File.basename(file, '.rb')
|
8
|
-
.gsub(/(^|_)(.)/) { Regexp.last_match(2).upcase }
|
9
|
-
|
10
|
-
"Cask/#{cop_name}"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
subject(:default_config) do
|
15
|
-
RuboCop::ConfigLoader.load_file('config/default.yml')
|
16
|
-
end
|
17
|
-
|
18
|
-
let(:cask_config_keys) do
|
19
|
-
default_config.keys.select { |k| k.start_with?('Cask/') }
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'has configuration for all cops' do
|
23
|
-
expect(cask_config_keys.sort).to eq(cop_names.sort)
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'has a nicely formatted description for all cops' do
|
27
|
-
cop_names.each do |name|
|
28
|
-
description = default_config[name]['Description']
|
29
|
-
expect(description).not_to be_nil
|
30
|
-
expect(description).not_to include("\n")
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|