Merge pull request #210 from decentral1se/parallel-linting-tox-travis

Add lint job to Tox and Travis
This commit is contained in:
Alexandre Aubin 2019-08-01 12:19:09 +02:00 committed by GitHub
commit c2886b3d3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 12 deletions

View file

@ -1,7 +1,14 @@
language: python
install: pip install tox pep8
python:
- 2.7
matrix:
include:
- python: 2.7
env: TOXENV=py27
- python: 2.7
env: TOXENV=lint
install:
- pip install tox
script:
- pep8 moulinette
- tox

View file

@ -55,3 +55,11 @@ Requirements
* python-gnupg (>= 0.3)
* python-ldap (>= 2.4)
* PyYAML
Testing
-------
```
$ pip install tox
$ tox
```

View file

@ -11,7 +11,7 @@ from gevent.queue import Queue
from geventwebsocket import WebSocketError
from bottle import run, request, response, Bottle, HTTPResponse
from bottle import get, post, install, abort, delete, put
from bottle import abort
from moulinette import msignals, m18n, DATA_DIR
from moulinette.core import MoulinetteError, clean_session

View file

@ -7,7 +7,6 @@ import locale
import logging
from argparse import SUPPRESS
from collections import OrderedDict
import time
import pytz
from datetime import date, datetime

View file

@ -3,7 +3,7 @@ import logging
# import all constants because other modules try to import them from this
# module because SUCCESS is defined in this module
from logging import (addLevelName, setLoggerClass, Logger, getLogger, NOTSET,
from logging import (addLevelName, setLoggerClass, Logger, getLogger, NOTSET, # noqa
DEBUG, INFO, WARNING, ERROR, CRITICAL)

View file

@ -1,2 +1,2 @@
[pep8]
ignore = E501,E128,E731
[flake8]
ignore = E501,E128,E731,E722

10
tox.ini
View file

@ -1,5 +1,7 @@
[tox]
envlist = py27
envlist =
py27
lint
skipdist = True
isolated_build = True
@ -15,3 +17,9 @@ deps =
requests-mock >= 1.6.0, < 2.0
commands =
pytest {posargs}
[testenv:lint]
commands = flake8 moulinette test
deps = flake8
skip_install = True
usedevelop = False