Kaydet (Commit) 1f357418 authored tarafından Batuhan Taşkaya's avatar Batuhan Taşkaya Kaydeden (comit) Berker Peksag

Integrate flake8 and coverage.py with tox (#141)

Fixes #38
üst ea4d9da9
[run]
branch = True
omit =
# omit the codegen because of deprecation
astor/codegen.py
.tox/*
[report]
show_missing = True
......@@ -16,3 +16,4 @@ And with some modifications based on Armin's code:
* Kodi Arfer <git@arfer.net>
* Felix Yan <felixonmars@archlinux.org>
* Chris Rink <chrisrink10@gmail.com>
* Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
......@@ -23,7 +23,7 @@ import sys
from .op_util import get_op_symbol, get_op_precedence, Precedence
from .node_util import ExplicitNodeVisitor
from .string_repr import pretty_string, string_triplequote_repr
from .string_repr import pretty_string
from .source_repr import pretty_source
......@@ -155,7 +155,6 @@ class SourceGenerator(ExplicitNodeVisitor):
AST = ast.AST
visit = self.visit
newline = self.newline
result = self.result
append = result.append
......
......@@ -81,7 +81,7 @@ def convert(srctree, dsttree=dsttree, readonly=False, dumpall=False,
try:
dsttxt = to_source(srcast)
except:
except Exception:
if not ignore_exceptions:
raise
dsttxt = ''
......
......@@ -101,8 +101,8 @@ def wrap_line(line, maxline=79, result=[], count=count):
pos = indent + count(first)
indentation += ' '
indent += 4
if indent >= maxline/2:
maxline = maxline/2 + indent
if indent >= maxline / 2:
maxline = maxline / 2 + indent
for sg, nsg in zip(splittable, unsplittable[1:]):
......
......@@ -107,6 +107,6 @@ def pretty_string(s, embedded, current_line, uni_lit=False,
try:
if eval(fancy) == s and '\r' not in fancy:
return fancy
except:
except Exception:
pass
return default
nose>=1.3.0
flake8>=3.7.0
coverage>=4.5.0
[tox]
envlist = py27, py34, py35, py36, py37, py38, pypy, pypy3.5
envlist =
py{27, 34, 35, 36, 37, 38, py, py3.5}
lint
skipsdist = True
skip_missing_interpreters = true
[testenv]
usedevelop = True
commands = nosetests -v --nocapture {posargs}
commands =
coverage run {envbindir}/nosetests -v --nocapture {posargs}
coverage report
deps =
-rrequirements-tox.txt
py27,pypy: unittest2
[testenv:lint]
deps = flake8
commands = flake8 astor/
[flake8]
ignore = E114, E116, E501, W504
[travis]
python =
3.7: py37, lint
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment