language: rust
before_script:
- rustup component add rustfmt

addons:
    apt:
        packages:
            - libasound2-dev
matrix:
    include:
        - name: "Test nightly"
          rust: nightly

        - name: "Test beta"
          rust: beta

        - name: "Test stable"
          rust: stable

        - name: "Validate doc"
          rust: stable
          script:
              - cargo doc --no-deps -v

script:
    - |
      if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
        cargo fmt --all -- --check
      fi
    - cargo build -v
    - cargo test -v


language: rust

addons:
    apt:
        packages:
            - libasound2-dev
matrix:
    include:
        - name: "Test nightly"
          rust: nightly

        - name: "Test beta"
          rust: beta

        - name: "Test stable"
          rust: stable

        - name: "Validate doc"
          rust: stable
          script:
              - cargo doc --no-deps -v

before_script:
    - |
      if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
        rustup component add rustfmt
      fi

script:
    - |
      if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
        cargo fmt --all -- --check
      fi
    - cargo build -v
    - cargo test -v


Add rustfmt only on stable branch
Add rustfmt only on stable branch
