# Travis CI fails to parse .travis.yml

**URL:** <https://travis-ci.community/t/travis-ci-fails-to-parse-travis-yml/6912>\
**Category:** Enterprise\
**Created:** [January 18, 2020, 3:51am UTC](https://travis-ci.community/t/travis-ci-fails-to-parse-travis-yml/6912 "2020-01-18T03:51:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OliBarrington](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/olibarrington/32/3745_2.png) [@OliBarrington](https://travis-ci.community/u/OliBarrington)\
**Post date:** [January 18, 2020, 3:51am UTC](https://travis-ci.community/t/travis-ci-fails-to-parse-travis-yml/6912/1 "2020-01-18T03:51:33Z")

</div>

I have this `travis.yml` which [travis-ci.org](http://travis-ci.org) complains it can’t parse.

```auto
language: rust
rust:
  - 1.31.0
  - stable
  - beta
  - nightly
matrix:
  allow_failures:
    - rust: nightly
sudo: false
before_script:
  - rustup component add rustfmt
  - rustup target add thumbv7em-none-eabihf # Any target that does not have a standard library will do
script:
  - cargo fmt --all -- --check
  - (rustup component add clippy && cargo clippy --all -- -D clippy::all) || true
  - cargo build
  - cargo test
  - cargo build --no-default-features --features alloc --target thumbv7em-none-eabihf # Test we can build a platform that does not have std.
  - cargo test --no-default-features --lib --tests # Run no_std tests
  - [[$TRAVIS_RUST_VERSION != "1.31.0"]] && cargo build --no-default-features --features alloc
  - cargo build --features unsealed_read_write # The crate should still build when the unsealed_read_write feature is enabled.
  - cargo build --no-default-features --features unsealed_read_write # The crate should still build when the unsealed_read_write feature is enabled and std disabled.

```

Online Travis.yml validation is less than helpful (deprecated and removed without a replacement).

What changes are needed so Travis does build again?

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [January 18, 2020, 3:52am UTC](https://travis-ci.community/t/travis-ci-fails-to-parse-travis-yml/6912/2 "2020-01-18T03:52:45Z")

</div>

Hey @OliBarrington,

The `[` character is special in YAML, like a few others. If your string starts with it, you need to quote it.

I recommend using a block scalar for longer strings. You can either use a literal block scalar, which will be taken as it is:

```auto
- |
  [[$TRAVIS_RUST_VERSION != "1.31.0"]] && cargo build --no-default-features --features alloc

```

or a folded block scalar which allows you to split the line over multiple lines. It will be folded together with spaces:

```auto
- >
  [[$TRAVIS_RUST_VERSION != "1.31.0"]]
  && cargo build --no-default-features --features alloc

```

I hope this helps Oli, if you need any more help with anything, be sure to post back here!

-Montana

---

<div class="post-metadata">

**Author:** ![OliBarrington](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/olibarrington/32/3745_2.png) [@OliBarrington](https://travis-ci.community/u/OliBarrington)\
**Post date:** [January 18, 2020, 3:58am UTC](https://travis-ci.community/t/travis-ci-fails-to-parse-travis-yml/6912/3 "2020-01-18T03:58:39Z")

</div>

That seemed to do the trick. Thanks a bunch!

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [January 18, 2020, 3:59am UTC](https://travis-ci.community/t/travis-ci-fails-to-parse-travis-yml/6912/4 "2020-01-18T03:59:33Z")

</div>

Glad I could be of help, be sure to post back if you have any more problems.

-Montana
