add flake8-checks to travis

This commit is contained in:
Patrick Kanzler 2017-01-30 02:29:08 +01:00
parent 81028f9a35
commit 337e8ee19e
No known key found for this signature in database
GPG Key ID: F07F07153306FCEF
6 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,8 @@ matrix:
env: TOXENV=pypy3 env: TOXENV=pypy3
- python: 2.7 - python: 2.7
env: TOXENV=docs env: TOXENV=docs
- python: 3.4
env: TOXENV=flake8
allow_failures: allow_failures:
- python: 3.5-dev - python: 3.5-dev
- python: nightly - python: nightly

View File

@ -9,3 +9,4 @@ universal=1
[flake8] [flake8]
exclude = .git,.tox,.github,.eggs,__pycache__,doc/conf.py,build,dist,capabilities-data,test,src/escpos/constants.py exclude = .git,.tox,.github,.eggs,__pycache__,doc/conf.py,build,dist,capabilities-data,test,src/escpos/constants.py
max-line-length = 120 max-line-length = 120
# future-imports = absolute_import, division, print_function, unicode_literals # we are not there yet

View File

@ -50,6 +50,9 @@ setuptools_scm_template = """\
# coding: utf-8 # coding: utf-8
# file generated by setuptools_scm # file generated by setuptools_scm
# don't change, don't track in version control # don't change, don't track in version control
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals from __future__ import unicode_literals
version = '{version}' version = '{version}'

View File

@ -33,9 +33,11 @@ def str_to_bool(string):
""" """
return string.lower() in ('y', 'yes', '1', 'true') return string.lower() in ('y', 'yes', '1', 'true')
# A list of functions that work better with a newline to be sent after them. # A list of functions that work better with a newline to be sent after them.
REQUIRES_NEWLINE = ('qr', 'barcode', 'text', 'block_text') REQUIRES_NEWLINE = ('qr', 'barcode', 'text', 'block_text')
# Used in demo method # Used in demo method
# Key: The name of escpos function and the argument passed on the CLI. Some # Key: The name of escpos function and the argument passed on the CLI. Some
# manual translation is done in the case of barcodes_a -> barcode. # manual translation is done in the case of barcodes_a -> barcode.
@ -568,5 +570,6 @@ def demo(printer, **kwargs):
command(**params) command(**params)
printer.cut() printer.cut()
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -20,4 +20,5 @@ class CodePageManager:
def get_encoding(self, encoding): def get_encoding(self, encoding):
return self.data[encoding] return self.data[encoding]
CodePages = CodePageManager(CAPABILITIES['encodings']) CodePages = CodePageManager(CAPABILITIES['encodings'])

View File

@ -22,5 +22,6 @@ commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:flake8] [testenv:flake8]
basepython = python basepython = python
# TODO add flake8-future
deps = flake8 deps = flake8
commands = flake8 commands = flake8