add renderer for lint
This commit is contained in:
parent
01a86c1dd5
commit
089deeb217
|
@ -7,7 +7,8 @@ module Travis::API::V3
|
||||||
content = params[:content] || request.body.read
|
content = params[:content] || request.body.read
|
||||||
parsed = Travis::Yaml.parse(content)
|
parsed = Travis::Yaml.parse(content)
|
||||||
warnings = parsed.nested_warnings.map { |k, m| { key: k, message: m } }
|
warnings = parsed.nested_warnings.map { |k, m| { key: k, message: m } }
|
||||||
{ lint: { warnings: warnings } }.to_json
|
payload = { lint: { warnings: warnings } }.to_json
|
||||||
|
payload
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
9
lib/travis/api/v3/renderer/lint.rb
Normal file
9
lib/travis/api/v3/renderer/lint.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
module Travis::API::V3
|
||||||
|
module Renderer::Lint
|
||||||
|
extend self
|
||||||
|
|
||||||
|
def render(payload)
|
||||||
|
{ Renderer.render_value(payload) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user