From 5bf49ab84c24cc92a512eeec051dda27bec42b62 Mon Sep 17 00:00:00 2001 From: Dean Scarff Date: Sat, 2 May 2020 08:47:21 +1000 Subject: [PATCH 1/2] Fix URL for R language configuration --- lib/travis/yml/schema/def/lang/r.rb | 2 +- schema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/travis/yml/schema/def/lang/r.rb b/lib/travis/yml/schema/def/lang/r.rb index bf481c2c6..e38543a69 100644 --- a/lib/travis/yml/schema/def/lang/r.rb +++ b/lib/travis/yml/schema/def/lang/r.rb @@ -10,7 +10,7 @@ class R < Type::Lang def define title 'R' summary 'R language support' - see 'Building an R Project': 'https://docs.travis-ci.com/user/languages/clojure/' + see 'Building an R Project': 'https://docs.travis-ci.com/user/languages/r/' matrix :r map :r_packages, to: :seq diff --git a/schema.json b/schema.json index d8659b8ec..ceac560b3 100644 --- a/schema.json +++ b/schema.json @@ -8081,7 +8081,7 @@ }, "summary": "R language support", "see": { - "Building an R Project": "https://docs.travis-ci.com/user/languages/clojure/" + "Building an R Project": "https://docs.travis-ci.com/user/languages/r/" }, "normal": true }, From bd021f3c05d1290677b6f84c1605dc27ebf70d63 Mon Sep 17 00:00:00 2001 From: Dean Scarff Date: Sat, 2 May 2020 08:49:03 +1000 Subject: [PATCH 2/2] Add use_devtools option for R language to schema Fixes validation warnings like "unknown key use_devtools". --- lib/travis/yml.rb | 1 + lib/travis/yml/schema/def/lang/r.rb | 1 + schema.json | 16 ++++++++++++++++ spec/travis/yml/accept/lang/r_spec.rb | 10 ++++++++++ spec/travis/yml/schema/accept/lang/r_spec.rb | 8 ++++++++ spec/travis/yml/schema/def/lang/r_spec.rb | 8 ++++++++ 6 files changed, 44 insertions(+) diff --git a/lib/travis/yml.rb b/lib/travis/yml.rb index 28cf795af..5772955aa 100644 --- a/lib/travis/yml.rb +++ b/lib/travis/yml.rb @@ -179,6 +179,7 @@ def r_keys warnings_are_errors remotes repos + use_devtools ) end memoize :r_keys diff --git a/lib/travis/yml/schema/def/lang/r.rb b/lib/travis/yml/schema/def/lang/r.rb index e38543a69..685951595 100644 --- a/lib/travis/yml/schema/def/lang/r.rb +++ b/lib/travis/yml/schema/def/lang/r.rb @@ -35,6 +35,7 @@ def define map :warnings_are_errors, to: :bool map :remotes, to: :str # this does not seem to be used in travis-build? map :repos, to: :map, strict: false + map :use_devtools, to: :bool end end end diff --git a/schema.json b/schema.json index ceac560b3..c0cd328af 100644 --- a/schema.json +++ b/schema.json @@ -8077,6 +8077,14 @@ "r" ] } + }, + "use_devtools": { + "type": "boolean", + "only": { + "language": [ + "r" + ] + } } }, "summary": "R language support", @@ -9178,6 +9186,14 @@ "r" ] } + }, + "use_devtools": { + "type": "object", + "only": { + "language": [ + "r" + ] + } } }, "normal": true diff --git a/spec/travis/yml/accept/lang/r_spec.rb b/spec/travis/yml/accept/lang/r_spec.rb index 8437f67e1..646202e06 100644 --- a/spec/travis/yml/accept/lang/r_spec.rb +++ b/spec/travis/yml/accept/lang/r_spec.rb @@ -293,4 +293,14 @@ it { should_not have_msg } end end + + describe 'use_devtools' do + describe 'given a bool' do + yaml %( + use_devtools: true + ) + it { should serialize_to use_devtools: true } + it { should_not have_msg } + end + end end diff --git a/spec/travis/yml/schema/accept/lang/r_spec.rb b/spec/travis/yml/schema/accept/lang/r_spec.rb index f9b2a0def..c22992655 100644 --- a/spec/travis/yml/schema/accept/lang/r_spec.rb +++ b/spec/travis/yml/schema/accept/lang/r_spec.rb @@ -172,5 +172,13 @@ it { should_not validate language: {:foo=>'foo'} } it { should_not validate language: [{:foo=>'foo'}] } end + describe 'use_devtools' do + it { should validate language: :r } + it { should_not validate language: 1 } + it { should_not validate language: true } + it { should_not validate language: [:r] } + it { should_not validate language: {:foo=>'foo'} } + it { should_not validate language: [{:foo=>'foo'}] } + end end end diff --git a/spec/travis/yml/schema/def/lang/r_spec.rb b/spec/travis/yml/schema/def/lang/r_spec.rb index a10d80afd..833bd053b 100644 --- a/spec/travis/yml/schema/def/lang/r_spec.rb +++ b/spec/travis/yml/schema/def/lang/r_spec.rb @@ -192,6 +192,14 @@ 'r' ] } + }, + use_devtools: { + type: :boolean, + only: { + language: [ + 'r' + ] + } } }, normal: true