Validating your .travis.yml
file before committing it reduces common build errors such as
- invalid YAML
- missing
language
key - unsupported runtime versions of Ruby, PHP, OTP, etc
- deprecated features or runtime aliases
Online Validation
Validate your .travis.yml
online by entering your github repository or by pasting the contents of your .travis.yml
into the form.
Command line Validation
To install the command line client, which requires Ruby 1.9.3 and RubyGems:
gem install travis --no-rdoc --no-ri
To run the command line lint tool:
# from any directory
travis lint [path to your .travis.yml]
Comments
4 comments
When I used ruby 1.9.3 to install travis, it will result an error:
```
ERROR: Error installing travis:
ffi requires Ruby version < 2.7.dev, >= 2.2.
```
But when I changed the version of ruby to 2.6.1, it will result another error:
```
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --no-rdoc
```
I'm confused how to install travis properly.
Then I googled the error message, and found that changing the option to `--no-document` can resolve this problem.
Please correct the documentation to avoid the need for root access:
gem install travis --user-install --no-rdoc --no-ri
Mainly travis linter remained unmaintained for years and reports lots of false errors:
Warnings for .travis.yml:
[x] unexpected key conditions, dropping
[x] unexpected key jobs, dropping
[x] value for addons section is empty, dropping
[x] in addons section: unexpected key apt, dropping
The online form linked to is missing or the link is broken. So, there currently is no way to lint a .travis.yml online? Is this correct?
Please sign in to leave a comment.