forked from ivopasmans-reading/DAPPER
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
132 lines (116 loc) · 3.42 KB
/
pyproject.toml
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
129
130
131
132
##################
# Config tests #
##################
[tool.pytest.ini_options]
minversion = "6.0"
# Since `--doctest-modules` requires specifying `dapper`,
# it means pytest won't discover `test` dir on its own.
# So to run all tests, do `pytest tests`.
addopts = """
--ignore=tests/test_plotting.py
--ignore=tests/test_demos.py
--doctest-modules dapper
--ignore-glob=**/QG/*
--ignore-glob=**/magic.py
--ignore-glob=**/autoscaler.py
--ignore-glob=**/demo.py
--ignore-glob=**/illust_*.py
--ignore-glob=dapper/mods/KS/compare_schemes.py
--ignore=dapper/mods/explore_props.py
"""
[tool.coverage.run]
branch = true # stricter
source = ["dapper"]
#omit = ["bad_file.py"]
[tool.coverage.report]
ignore_errors = true
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:"
]
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py3{7,8,9}
toxworkdir={homedir}/.tox
[testenv]
platform = linux|darwindeps
deps = {toxinidir}
extras = test
setenv =
IS_TOX = true
commands =
pytest {posargs}
"""
####################
# Config linting #
####################
[tool.autopep8]
max_line_length = 88
ignore = "W6"
[tool.flakeheaven]
exclude = [".*", "README.*", "examples/*.ipynb", "autoscaler.py"]
max_line_length = 88
format = "grouped" # also try "stat"
show_source = false
#whitelist = "../../allowlist.txt" # Used by flake8-spellcheck.
[tool.flakeheaven.plugins]
pyflakes = ["+*"]
pycodestyle = ["+*",
# flake8 defaults:
"-E24", "-W503", "-E123", "-E226", "-E704", "-E121", "-W504", "-E126",
"-E711", "-E712", # "Comparison to True/None should be with 'is'"
"-E221", # Allow operator alignment
"-E251", # Allow operator alignment for dicts
"-E266", # Allow ## block comments
"-C408", # Prefer {} to dict()
# "-E271", "-E701", and more... # if-list alignment
# "-E201", "-E202", "-E203", "-E241", "-E231", # leave arrays as printed
"-E202", "-E203",
# "-E301", "-E302", # dont put spaces between functions
]
#mccabe = ["+*"]
#pylint = ["+*"]
pep8-naming = ["+*", # disable almost all
"-N80[1-3]", "-N806", "-N81[1-7]"]
#flake8-bandit = ["-*"]
flake8-bugbear = ["+*"]
flake8-builtins = ["+*"]
flake8-comprehensions = ["+*", "-C408"]
#flake8-darglint = ["+*"]
flake8-commas = ["+*"]
flake8-docstrings = ["+*",
"-D105",
"-D401", # issues/68
"-D102", "-D103", "-D107", "-D400", # TODO 4: enable these
]
#flake8-eradicate = ["+*"]
#flake8-isort = ["+*"]
#flake8-pytest-style = ["+*"]
#flake8-spellcheck = ["+*"]
[tool.flakeheaven.exceptions."**/__init__.py"]
pyflakes = ["-F401"] # "imported but unused"
pycodestyle = ["-E402"] # "module level import not at top of file"
[tool.flakeheaven.exceptions."dapper/da_methods/"]
"flake8-*" = ["-D102"]
[tool.flakeheaven.exceptions."dapper/mods/explore_props.py"]
pyflakes = ["-F811"]
[tool.flakeheaven.exceptions."dapper/mods/*.py"]
# Model configs are supposed to allow a little sloppiness.
flake8-docstrings = ["-D*"] # "missing docstring"
flake8-bugbear = ["-B007"] # "loop var not used
[tool.flakeheaven.exceptions."tests/test_data.py"]
pycodestyle = [
"-W291", # "trailing whitespace"
"-E501", # "line too long"
]
[tool.flakeheaven.exceptions."tests/test_example_2.py"]
pycodestyle = ["-E501"]
[tool.flakeheaven.exceptions."examples/"]
pycodestyle = ["-E201", "-E402"]
flake8-docstrings = ["-D100", "-D200"]