Skip to content

Commit

Permalink
add support for tox with pylint, pyunit, flake8, black, shellcheck
Browse files Browse the repository at this point in the history
add support for tox with pylint, pyunit, flake8, black, shellcheck
  • Loading branch information
richm committed Sep 1, 2020
1 parent dacc8fb commit 2c74c32
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# SPDX-License-Identifier: MIT
---
language: shell
dist: bionic
os: linux
script:
- shellcheck *.sh
# https://docs.travis-ci.com/user/languages/python/#using-tox-as-the-build-script
language: minimal
preinstall:
- sudo apt-get update
- sudo apt-get install -y python3-pip
- pip3 install tox
script: tox
54 changes: 54 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# SPDX-License-Identifier: MIT
[tox]
envlist =
black, flake8, pylint, pytest
shellcheck
skipsdist = true

[testenv]
passenv = *
basepython = python3
whitelist_externals =
bash
find
shellcheck
deps =
black: black
flake8: flake8
pylint: colorama
pylint: pylint>=1.8.4
pylint: pyyaml
commands =
black: black --check --diff {posargs} .
flake8: flake8 {posargs} .
pylint: bash -c 'find \( -name .tox -prune \) -o \( -name .venv -prune \) -o -name \*.py -print | xargs pylint --errors-only {posargs}'
shellcheck: bash -c 'shellcheck -e SC1090 *.sh'

[testenv:pytest]
changedir = {toxinidir}/tests/unit
deps =
pytest
pyyaml
setenv =
PYTHONPATH={toxinidir}
commands = pytest {posargs}

[pytest]
addopts = -rxs

[flake8]
show_source = true
max-line-length = 88
ignore = E402,W503
exclude = .venv,.tox
statistics = true
#verbose = 3

[pylint]
max-line-length = 88

[pycodestyle]
max-line-length = 88

[travis]
python = black, flake8, pylint, pytest, shellcheck

0 comments on commit 2c74c32

Please sign in to comment.