language: python

# Supported Python versions
python:
  - "2.7"
  - "3.4"
  - "3.5"
  - "3.6"
  - "3.7"
  - "3.8"

install:
  # The test suite needs a gsed command
  - ln -s /bin/sed ~/bin/gsed

  # Only run pylint/black in Python 3.6
  - case $TRAVIS_PYTHON_VERSION in 3.6)
    pip install --quiet -r requirements-dev.txt;;
    esac

  # Download clitest
  - curl -sOL https://raw.githubusercontent.com/aureliojargas/clitest/master/clitest
  - chmod +x clitest
  - mv clitest ~/bin

  # Install sedsed itself and its dependency (sedparse)
  - pip install -e .

script:
  - case $TRAVIS_PYTHON_VERSION in 3.6)
    pylint ./*.py test/*.py;;
    esac
  - case $TRAVIS_PYTHON_VERSION in 3.6)
    black --check ./*.py test/*.py;;
    esac
  - find . -name run | xargs shellcheck -x
  - clitest test/command_line.md
  - ./test/run

### Environment
# Ubuntu 14.04.5 LTS
# /bin/sed v4.2.2
# uid=2000(travis) groups=2000(travis),999(docker)
# PWD=/home/travis/build/aureliojargas/sedsed
# PATH=/home/travis/bin
#      /home/travis/.local/bin
#      /usr/local/sbin
#      /usr/local/bin
#      /usr/sbin
#      /usr/bin
#      /sbin
#      /bin
