travis-lint 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/lib/travis/lint/linter.rb +8 -14
- data/lib/travis/lint/version.rb +1 -1
- data/spec/travis_lint_runner_spec.rb +1 -1
- data/spec/travis_lint_spec.rb +27 -23
- data/travis-lint.gemspec +2 -2
- metadata +21 -21
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# What is travis-lint
|
2
2
|
|
3
|
-
`travis-lint` is a tool that checks your `.travis.yml` file for possible issues, deprecations and so on.
|
3
|
+
`travis-lint` is a tool that checks your `.travis.yml` file for possible issues, deprecations and so on.
|
4
|
+
Supporting the gem, there's also an online version of this tool at [lint.travis-ci.org](http://lint.travis-ci.org).
|
4
5
|
|
5
6
|
[![Continuous Integration status](https://secure.travis-ci.org/travis-ci/travis-lint.png)](http://travis-ci.org/travis-ci/travis-lint)
|
6
7
|
|
data/lib/travis/lint/linter.rb
CHANGED
@@ -30,16 +30,6 @@ module Travis
|
|
30
30
|
validate(hsh).empty?
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
#
|
35
|
-
# General
|
36
|
-
#
|
37
|
-
|
38
|
-
validator_for :all, :language, "The \"language\" key is mandatory" do |hsh|
|
39
|
-
blank? hsh[:language]
|
40
|
-
end
|
41
|
-
|
42
|
-
|
43
33
|
#
|
44
34
|
# Erlang
|
45
35
|
#
|
@@ -93,11 +83,11 @@ module Travis
|
|
93
83
|
|
94
84
|
|
95
85
|
KNOWN_RUBY_VERSIONS = %w(1.8.7 ruby-1.8.7 1.9.2 ruby-1.9.2 1.9.3 ruby-1.9.3 ruby-head jruby jruby-18mode jruby-19mode rbx rbx-18mode rbx-19mode jruby-head ree ree-1.8.7)
|
96
|
-
KNOWN_NODE_VERSIONS = %w(0.
|
86
|
+
KNOWN_NODE_VERSIONS = %w(0.6 0.8 0.9)
|
97
87
|
KNOWN_PHP_VERSIONS = %w(5.2 5.3 5.3.2 5.3.8 5.4)
|
98
88
|
|
99
|
-
KNOWN_PYTHON_VERSIONS = %w(2.5 2.6 2.7 3.
|
100
|
-
KNOWN_PERL_VERSIONS = %w(5.10 5.12 5.14)
|
89
|
+
KNOWN_PYTHON_VERSIONS = %w(2.5 2.6 2.7 3.2)
|
90
|
+
KNOWN_PERL_VERSIONS = %w(5.10 5.12 5.14 5.16)
|
101
91
|
|
102
92
|
|
103
93
|
#
|
@@ -133,7 +123,11 @@ module Travis
|
|
133
123
|
("node_js" == hsh[:language].to_s.downcase) && hsh[:node_js].is_a?(Array) && !known_node_js_versions?(hsh[:node_js])
|
134
124
|
end
|
135
125
|
|
136
|
-
|
126
|
+
validator_for :all, :matrix, "Allowed matrix failures must contain a list of hashes." do |hash|
|
127
|
+
if hash[:matrix] and hash[:matrix][:allow_failures]
|
128
|
+
!hash[:matrix][:allow_failures].any?{|failure| failure.is_a?(Hash)}
|
129
|
+
end
|
130
|
+
end
|
137
131
|
|
138
132
|
protected
|
139
133
|
|
data/lib/travis/lint/version.rb
CHANGED
@@ -15,7 +15,7 @@ describe "A .travis.yml" do
|
|
15
15
|
|
16
16
|
begin
|
17
17
|
capture_stdout do
|
18
|
-
Travis::Lint::Runner.new(["spec/files/
|
18
|
+
Travis::Lint::Runner.new(["spec/files/uses_unsupported_perl.yml"]).run()
|
19
19
|
end
|
20
20
|
rescue SystemExit => e
|
21
21
|
status = e.status
|
data/spec/travis_lint_spec.rb
CHANGED
@@ -31,8 +31,6 @@ describe "A .travis.yml" do
|
|
31
31
|
|
32
32
|
let(:docs) { "Travis CI documentation at http://bit.ly/travis-ci-environment" }
|
33
33
|
|
34
|
-
|
35
|
-
|
36
34
|
def content_of_sample_file(name)
|
37
35
|
path = Pathname.new(File.join("spec", "files", name)).expand_path
|
38
36
|
|
@@ -40,10 +38,10 @@ describe "A .travis.yml" do
|
|
40
38
|
end
|
41
39
|
|
42
40
|
context "that is blank" do
|
43
|
-
it "is
|
44
|
-
Travis::Lint::Linter.validate({}).
|
41
|
+
it "is valid" do
|
42
|
+
Travis::Lint::Linter.validate({}).should_not include(language_key_is_mandatory)
|
45
43
|
|
46
|
-
Travis::Lint::Linter.valid?(content_of_sample_file("no_language_key.yml")).should
|
44
|
+
Travis::Lint::Linter.valid?(content_of_sample_file("no_language_key.yml")).should be_true
|
47
45
|
end
|
48
46
|
end
|
49
47
|
|
@@ -61,7 +59,6 @@ describe "A .travis.yml" do
|
|
61
59
|
end
|
62
60
|
end
|
63
61
|
|
64
|
-
|
65
62
|
context "and uses jruby instead of jruby-18mode" do
|
66
63
|
let(:travis_yml) do
|
67
64
|
{ :language => "ruby", :rvm => ["jruby"] }
|
@@ -73,7 +70,6 @@ describe "A .travis.yml" do
|
|
73
70
|
end
|
74
71
|
end
|
75
72
|
|
76
|
-
|
77
73
|
context "and uses rbx instead of rbx-18mode" do
|
78
74
|
let(:travis_yml) do
|
79
75
|
{ :language => "ruby", :rvm => ["rbx", "1.9.3"] }
|
@@ -84,7 +80,6 @@ describe "A .travis.yml" do
|
|
84
80
|
end
|
85
81
|
end
|
86
82
|
|
87
|
-
|
88
83
|
context "and uses rbx-2.0 instead of rbx-18mode" do
|
89
84
|
let(:travis_yml) do
|
90
85
|
{ :language => "ruby", :rvm => ["rbx-2.0", "1.9.3"] }
|
@@ -96,7 +91,6 @@ describe "A .travis.yml" do
|
|
96
91
|
end
|
97
92
|
end
|
98
93
|
|
99
|
-
|
100
94
|
context "and uses rbx-2.0.0pre instead of rbx-18mode" do
|
101
95
|
let(:travis_yml) do
|
102
96
|
{ :language => "ruby", :rvm => ["rbx-2.0.0pre", "1.9.3"] }
|
@@ -107,8 +101,6 @@ describe "A .travis.yml" do
|
|
107
101
|
end
|
108
102
|
end
|
109
103
|
|
110
|
-
|
111
|
-
|
112
104
|
context "and uses an unsupported Ruby version" do
|
113
105
|
let(:unsupported_rubies) do
|
114
106
|
{ :key => :rvm, :issue => "Detected unsupported Ruby versions. For an up-to-date list of supported Rubies, see #{docs}" }
|
@@ -124,7 +116,6 @@ describe "A .travis.yml" do
|
|
124
116
|
end
|
125
117
|
end
|
126
118
|
|
127
|
-
|
128
119
|
context "that specifies Ruby as the language but tries to set node_js version" do
|
129
120
|
let(:travis_yml) do
|
130
121
|
{ :language => "ruby", :rvm => ["1.9.3"], :node_js => ["0.6"] }
|
@@ -136,8 +127,6 @@ describe "A .travis.yml" do
|
|
136
127
|
end
|
137
128
|
end
|
138
129
|
|
139
|
-
|
140
|
-
|
141
130
|
context "that has language set to node_js" do
|
142
131
|
context "and uses an unsupported Node.js version" do
|
143
132
|
let(:unsupported_nodejs) do
|
@@ -155,7 +144,6 @@ describe "A .travis.yml" do
|
|
155
144
|
end
|
156
145
|
end
|
157
146
|
|
158
|
-
|
159
147
|
context "that has language set to PHP" do
|
160
148
|
context "and uses an unsupported PHP version" do
|
161
149
|
let(:unsupported_php) do
|
@@ -173,8 +161,6 @@ describe "A .travis.yml" do
|
|
173
161
|
end
|
174
162
|
end
|
175
163
|
|
176
|
-
|
177
|
-
|
178
164
|
context "that has language set to Python" do
|
179
165
|
context "and uses an unsupported Python version" do
|
180
166
|
let(:unsupported_python) do
|
@@ -192,8 +178,6 @@ describe "A .travis.yml" do
|
|
192
178
|
end
|
193
179
|
end
|
194
180
|
|
195
|
-
|
196
|
-
|
197
181
|
context "that has language set to Perl" do
|
198
182
|
context "and uses an unsupported Perl version" do
|
199
183
|
let(:unsupported_perl) do
|
@@ -211,10 +195,6 @@ describe "A .travis.yml" do
|
|
211
195
|
end
|
212
196
|
end
|
213
197
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
198
|
context "that has language set to erlang" do
|
219
199
|
context "but has no \"otp_release\" key" do
|
220
200
|
it "is invalid" do
|
@@ -223,4 +203,28 @@ describe "A .travis.yml" do
|
|
223
203
|
end
|
224
204
|
end
|
225
205
|
end
|
206
|
+
|
207
|
+
context "with a build matrix" do
|
208
|
+
let(:build_matrix_is_not_list_of_hashes) {
|
209
|
+
{:key => :matrix, :issue => "Allowed matrix failures must contain a list of hashes."}
|
210
|
+
}
|
211
|
+
context "with allow_failures" do
|
212
|
+
let(:invalid_matrix) {
|
213
|
+
{:matrix => {:allow_failures => ["ruby-head"]}}
|
214
|
+
}
|
215
|
+
|
216
|
+
let(:valid_matrix) {
|
217
|
+
{:matrix => {:allow_failures => [{"rvm" => "ruby-head"}]}}
|
218
|
+
}
|
219
|
+
|
220
|
+
it "is invalid when the allowed failures are not a list of hashes" do
|
221
|
+
Travis::Lint::Linter.validate(invalid_matrix).should include(build_matrix_is_not_list_of_hashes)
|
222
|
+
Travis::Lint::Linter.valid?(invalid_matrix).should == false
|
223
|
+
end
|
224
|
+
|
225
|
+
it "is valid when allowed failures are a list of hashes" do
|
226
|
+
Travis::Lint::Linter.valid?(valid_matrix).should == true
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
226
230
|
end
|
data/travis-lint.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
|
-
s.
|
19
|
+
s.add_dependency("hashr", "~> 0.0.22")
|
20
20
|
|
21
|
-
s.add_development_dependency("rspec",
|
21
|
+
s.add_development_dependency("rspec", "~> 2.8")
|
22
22
|
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: travis-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0
|
5
4
|
prerelease:
|
5
|
+
version: 1.5.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Michael S. Klishin
|
@@ -10,40 +10,40 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-12-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.0.
|
20
|
+
version: 0.0.22
|
21
|
+
none: false
|
22
|
+
name: hashr
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
|
26
|
-
none: false
|
25
|
+
requirement: !ruby/object:Gem::Requirement
|
27
26
|
requirements:
|
28
|
-
- -
|
27
|
+
- - ~>
|
29
28
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.0.
|
31
|
-
- !ruby/object:Gem::Dependency
|
32
|
-
name: rspec
|
33
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
+
version: 0.0.22
|
34
30
|
none: false
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
35
33
|
requirements:
|
36
34
|
- - ~>
|
37
35
|
- !ruby/object:Gem::Version
|
38
|
-
version: 2.8
|
36
|
+
version: '2.8'
|
37
|
+
none: false
|
38
|
+
name: rspec
|
39
39
|
type: :development
|
40
40
|
prerelease: false
|
41
|
-
|
42
|
-
none: false
|
41
|
+
requirement: !ruby/object:Gem::Requirement
|
43
42
|
requirements:
|
44
43
|
- - ~>
|
45
44
|
- !ruby/object:Gem::Version
|
46
|
-
version: 2.8
|
45
|
+
version: '2.8'
|
46
|
+
none: false
|
47
47
|
description: travis-lint is a tool that check your .travis.yml for possible issues,
|
48
48
|
deprecations and so on. Recommended for all travis-ci.org users.
|
49
49
|
email:
|
@@ -88,20 +88,20 @@ rdoc_options: []
|
|
88
88
|
require_paths:
|
89
89
|
- lib
|
90
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
-
none: false
|
92
91
|
requirements:
|
93
92
|
- - ! '>='
|
94
93
|
- !ruby/object:Gem::Version
|
95
94
|
version: '0'
|
96
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
95
|
none: false
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
97
|
requirements:
|
99
98
|
- - ! '>='
|
100
99
|
- !ruby/object:Gem::Version
|
101
100
|
version: '0'
|
101
|
+
none: false
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 1.8.
|
104
|
+
rubygems_version: 1.8.23
|
105
105
|
signing_key:
|
106
106
|
specification_version: 3
|
107
107
|
summary: Checks your .travis.yml for possible issues, deprecations and so on
|