.travis.yml linting/schmema

Many IDEs now support live linting and predictive typing for JSON/YAML files using JSON Schema, e.g. Visual Studio Code and the Jetbrains IDEs. I find this feature to be very useful.

Most editors seem to get their schemas from schemastore.org, which also provides a .travis.yml schema. But that schema seems to be missing many Travis features and also produces some false errors. Judging from the activity on the github repository people seem to be building that schema manually from the documentation which seems very inefficient and error prone.

Since Travis CI is linting .travis.yml internally and also provides an API endpoint for it, I suppose there must be a valid machine readable definition for it. It shouldn’t be hard to build a valid and up-to-date JSON schema from it, right?

I searched around a little but I only found travis-ci/travis-yaml, which seems to be a stale project, not having seen any updates for over a year and still having many open issues and PRs. Before I start the probably time-consuming job of transforming this rather complicated representation of the .travis.yml format into a JSON schema I wanted to confirm that this is still the officially used and up-to-date .travis.yml definition used on Travis CI? Or is there any other resource?

I think many users would benefit from an updated schema since it’s much more convenient than using the CLI or an online service to lint your configuration file and can also be easily used in any third party tool independent from the language it’s implemented in.

Many thanks and so long
Felix

3 Likes

Travis already has its own linter and I wanted to integrate it with pre-commit but I discovered that there is a 3 year old PR that adds this funtionality. But nobody from travis team reviewed it.

See https://github.com/travis-ci/travis.rb/pull/307 and if you want to see it happening, please comment on it.

1 Like

That’s a good point @ssbarnea! :+1: