Skip to content

Commit bd021f3

Browse files
committed
Add use_devtools option for R language to schema
Fixes validation warnings like "unknown key use_devtools".
1 parent 5bf49ab commit bd021f3

File tree

6 files changed

+44
-0
lines changed

6 files changed

+44
-0
lines changed

lib/travis/yml.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def r_keys
179179
warnings_are_errors
180180
remotes
181181
repos
182+
use_devtools
182183
)
183184
end
184185
memoize :r_keys

lib/travis/yml/schema/def/lang/r.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def define
3535
map :warnings_are_errors, to: :bool
3636
map :remotes, to: :str # this does not seem to be used in travis-build?
3737
map :repos, to: :map, strict: false
38+
map :use_devtools, to: :bool
3839
end
3940
end
4041
end

schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8077,6 +8077,14 @@
80778077
"r"
80788078
]
80798079
}
8080+
},
8081+
"use_devtools": {
8082+
"type": "boolean",
8083+
"only": {
8084+
"language": [
8085+
"r"
8086+
]
8087+
}
80808088
}
80818089
},
80828090
"summary": "R language support",
@@ -9178,6 +9186,14 @@
91789186
"r"
91799187
]
91809188
}
9189+
},
9190+
"use_devtools": {
9191+
"type": "object",
9192+
"only": {
9193+
"language": [
9194+
"r"
9195+
]
9196+
}
91819197
}
91829198
},
91839199
"normal": true

spec/travis/yml/accept/lang/r_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,14 @@
293293
it { should_not have_msg }
294294
end
295295
end
296+
297+
describe 'use_devtools' do
298+
describe 'given a bool' do
299+
yaml %(
300+
use_devtools: true
301+
)
302+
it { should serialize_to use_devtools: true }
303+
it { should_not have_msg }
304+
end
305+
end
296306
end

spec/travis/yml/schema/accept/lang/r_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,13 @@
172172
it { should_not validate language: {:foo=>'foo'} }
173173
it { should_not validate language: [{:foo=>'foo'}] }
174174
end
175+
describe 'use_devtools' do
176+
it { should validate language: :r }
177+
it { should_not validate language: 1 }
178+
it { should_not validate language: true }
179+
it { should_not validate language: [:r] }
180+
it { should_not validate language: {:foo=>'foo'} }
181+
it { should_not validate language: [{:foo=>'foo'}] }
182+
end
175183
end
176184
end

spec/travis/yml/schema/def/lang/r_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@
192192
'r'
193193
]
194194
}
195+
},
196+
use_devtools: {
197+
type: :boolean,
198+
only: {
199+
language: [
200+
'r'
201+
]
202+
}
195203
}
196204
},
197205
normal: true

0 commit comments

Comments
 (0)