forked from fonttools/fontbakery
-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
128 lines (119 loc) · 6.11 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
[tox]
envlist = py36, py37, py38, coverage, flake8, pylint
[gh-actions]
python =
3.6: py36, coverage, flake8, pylint
3.7: py37, coverage, flake8, pylint
3.8: py38, coverage, flake8, pylint
# we won't test on py3.9 for now
# because pylint has an annoying bug:
# https://github.com/PyCQA/pylint/issues/3882
[testenv]
deps =
pytest
coverage
ufo2ft
-rrequirements.txt
commands = coverage run -m pytest {posargs}
passenv = LD_LIBRARY_PATH LD_PRELOAD
[testenv:coverage]
deps = coverage
skip_install = true
commands =
coverage combine
coverage report
coverage html
# Exclude a lot of tests here without turning them off in setup.cfg, because a
# developer might want to see and fix them. This is more of a regression test.
[testenv:flake8]
deps =
flake8
sphinx
sphinx_rtd_theme
recommonmark
commands = flake8 --count --show-source --statistics
# Same rationale as with flake8.
[testenv:pylint]
deps =
pylint
sphinx
sphinx_rtd_theme
recommonmark
wont_fix = invalid-name,bad-indentation,inconsistent-return-statements,too-many-return-statements,too-many-public-methods
maybe_someday = fixme,missing-docstring,too-many-locals,too-many-branches,too-many-statements,bad-continuation,unidiomatic-typecheck,logging-format-interpolation,too-many-nested-blocks,superfluous-parens,bare-except,undefined-loop-variable,too-many-instance-attributes,old-style-class,unnecessary-pass,unused-argument,consider-iterating-dictionary,attribute-defined-outside-init,too-many-boolean-expressions,too-many-arguments,wrong-import-order,bad-whitespace,pointless-string-statement,pointless-statement,redefined-builtin,global-statement,too-many-lines,global-variable-undefined,redefined-variable-type,multiple-statements,expression-not-assigned,too-many-format-args,deprecated-lambda,broad-except,no-self-use,no-name-in-module,abstract-method,no-member,line-too-long,trailing-newlines,duplicate-code,redefined-outer-name,trailing-whitespace,unused-variable,logging-not-lazy,undefined-variable,protected-access,anomalous-backslash-in-string,wrong-import-position,ungrouped-imports,singleton-comparison,misplaced-comparison-constant,consider-using-enumerate,used-before-assignment,too-few-public-methods,dangerous-default-value,unexpected-keyword-arg,len-as-condition,no-else-return,relative-import,not-callable,unsupported-membership-test,keyword-arg-before-vararg,consider-using-ternary,useless-return,chained-comparison,consider-using-in,useless-object-inheritance,no-else-raise,c-extension-no-member,import-outside-toplevel,unnecessary-comprehension,unused-import,raise-missing-from
commands = pylint --disable={[testenv:pylint]wont_fix},{[testenv:pylint]maybe_someday} Lib/fontbakery
[flake8]
select = E,F,W
exclude =
# Exclude the entire build directory:
build
# Exclude these auto-generated files that should not be hand-edited:
Lib/fontbakery/fonts_public_pb2.py,
Lib/fontbakery/axes_pb2.py,
Lib/fontbakery/designers_pb2.py,
# No need to traverse hidden directories such as .git, .tox
.*,
# Exclude virtual environment directory:
venv*,
# There's no value in checking cache directories
__pycache__,
# The conf file is mostly autogenerated, ignore it
docs/source/conf.py,
# max-line-length=88 # un-comment when E501 is removed from ignore
ignore =
# ITEMS BELOW ARE MEDIUM PRIORITY TO FIX AND REMOVE FROM IGNORE LIST
E402, # module level import not at top of file
E711, # comparison to None should be 'if cond is None
E712, # comparison to True should be 'if cond is True:' or 'if cond:'
E713, # test for membership should be 'not in'
E722, # do not use bare 'except'
E741, # ambiguous variable name
F401, # '<module>' imported but unused
F403, # 'from <module> import *' used; unable to detect undefined names
F405, # '<name>' may be undefined, or defined from star imports
# ITEMS BELOW ARE LOWER PRIORITY TO FIX AND REMOVE FROM IGNORE LIST
E111, # indentation is not a multiple of four
E114, # indentation is not a multiple of four (comment)
E116, # unexpected indentation (comment)
E117, # over-indented (comment)
E122, # continuation line missing indentation or outdented
E123, # closing bracket does not match indentation of opening bracket's line
E124, # closing bracket does not match visual indentation
E125, # continuation line with same indent as next logical line
E126, # continuation line over-indented for hanging indent
E127, # continuation line over-indented for visual indent
E128, # continuation line under-indented for visual indent
E129, # visually indented line with same indent as next logical line
E131, # continuation line unaligned for hanging indent
E201, # whitespace after '{'
E202, # whitespace before ')'
E203, # whitespace before ','
E211, # whitespace before '('
E221, # multiple spaces before operator
E222, # multiple spaces after operator
E225, # missing whitespace around operator
E226, # missing whitespace around arithmetic operator
E231, # missing whitespace after ','
E241, # multiple spaces after ':'
E251, # unexpected spaces around keyword / parameter equals
E261, # at least two spaces before inline comment
E262, # inline comment should start with '# '
E265, # block comment should start with '# '
E266, # too many leading '#' for block comment
E272, # multiple spaces before keyword
E302, # expected <n> blank lines, found <m>
E303, # too many blank lines (<n>)
E305, # expected 2 blank lines after class or function definition, found <n>
E306, # expected 1 blank line before a nested definition, found <n>
E501, # line too long
E502, # the backslash is redundant between brackets
E701, # multiple statements on one line (colon)
E704, # multiple statements on one line (def)
E731, # do not assign a lambda expression, use a def
F541, # f-string is missing placeholders
W191, # indentation contains tabs
W291, # trailing whitespace
W293, # blank line contains whitespace
W391, # blank line at end of file
W503, # line break before binary operator
W504, # line break after binary operator