Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R language schema specification #174

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/travis/yml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def r_keys
warnings_are_errors
remotes
repos
use_devtools
)
end
memoize :r_keys
Expand Down
3 changes: 2 additions & 1 deletion lib/travis/yml/schema/def/lang/r.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 17 additions & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8077,11 +8077,19 @@
"r"
]
}
},
"use_devtools": {
"type": "boolean",
"only": {
"language": [
"r"
]
}
}
},
"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
},
Expand Down Expand Up @@ -9178,6 +9186,14 @@
"r"
]
}
},
"use_devtools": {
"type": "object",
"only": {
"language": [
"r"
]
}
}
},
"normal": true
Expand Down
10 changes: 10 additions & 0 deletions spec/travis/yml/accept/lang/r_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions spec/travis/yml/schema/accept/lang/r_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions spec/travis/yml/schema/def/lang/r_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@
'r'
]
}
},
use_devtools: {
type: :boolean,
only: {
language: [
'r'
]
}
}
},
normal: true
Expand Down