This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
149 lines (138 loc) · 4.74 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
[isort]
default_section = THIRDPARTY
force_grid_wrap = 0
force_single_line = 1
line_length = 88
order_by_type = false
# Headings
import_heading_stdlib = Standard library
import_heading_thirdparty = Third-party
import_heading_firstparty = First-party
import_heading_localfolder = Local
# Known modules to avoid misclassification
known_standard_library =
# Add standard library modules that are misclassified by isort
known_third_party =
# Add third-party modules that are misclassified by isort
click
known_first_party =
# Add first-party modules that are misclassified by isort
fls_sat_verif
[flake8]
exclude = docs
max-line-length = 88
ignore =
E203, # Allow whitespace before ':' (https://github.com/PyCQA/pycodestyle/issues/373)
F811, # Allow redefinition of unused name (necessary for typing.overload)
I002, # Don't check for isort configuration
W503, # Allow line break before binary operator (PEP 8-compatible)
[pydocstyle]
# All codes: http://www.pydocstyle.org/en/stable/error_codes.html
ignore =
# D100, # Missing docstring in public module
D101, # Missing docstring in public class
D102, # Missing docstring in public method
D103, # Missing docstring in public function
# D104, # Missing docstring in public package
D105, # Missing docstring in magic method
# D105, # Missing docstring in public nested class
# D107, # Missing docstring in __init__
D203, # Blank line required before class docstring
D213, # Multi-line docstring summary should start at the second line
# D405, # Section name should be properly capitalized
D406, # Section name should end with a newline
D407, # Missing dashed underline after section
[pylint]
ignore-imports = yes
max-line-length = 88
# Tweak valid name formats
# Defaults (http://pylint-messages.wikidot.com/messages:c0103):
# argument-rgx = ^[a-z_][a-z0-9_]{2,30}$
# attr-rgx = ^[a-z_][a-z0-9_]{2,30}$
# function-rgx = ^[a-z_][a-z0-9_]{2,30}$
# method-rgx = ^[a-z_][a-z0-9_]{2,30}$
# variable-rgx = ^[a-z_][a-z0-9_]{2,30}$
# class-rgx = ^[A-Z_][a-zA-Z0-9]+$
# const-rgx = ^(([A-Z_][A-Z0-9_]*)|(__.*__))$
# module-rgx = ^(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
argument-rgx = ^[a-z_][a-z0-9_]{,40}$
attr-rgx = ^[a-z_][a-z0-9_]{,40}$
function-rgx = ^[a-z_][a-z0-9_]{,40}$
method-rgx = ^[a-z_][a-z0-9_]{,40}$
variable-rgx = ^[a-z_][a-z0-9_]{,40}$
class-rgx = ^[A-Z_][a-zA-Z0-9]+$
const-rgx = ^(([a-z_][a-z0-9_]*)|([A-Z_][A-Z0-9_]*)|(__[a-zA-Z0-9]+__))$
module-rgx = ^(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
inlinevar-rgx = ^[A-Za-z_][A-Za-z0-9_]*$
# Disable selected warnings, errors etc. that conflict with style guide etc.
# Note: To locally ignore certain errors, use "pylint: disable=XXXX" comments instead!
disable =
C0115, # Missing class docstring
C0116, # Missing function or method docstring
C0330, # Wrong hanging indentation before block (add 4 spaces)
R0903, # Too few public methods (*/2) (too-few-public-methods)
# R0801, # Similar lines in 2 files (duplicate-code)
# -> see https://github.com/PyCQA/pylint/issues/214
R1705, # Unnecessary "elif" after "return" (no-else-return)
R1720, # Unnecessary "elif" after "raise" (no-else-raise)
R1724, # Unnecessary "elif" after "continue" (no-else-continue)
W1116, # Second argument of isinstance is not a type (isinstance-second-argument-not-valid-type)
# Ignore (sub-)modules that trigger errors like E1101 (no-member) or E0611 (no-name-in-module)
ignored-modules =
[pytest]
testpaths = tests
addopts =
-s
-ra
--pdbcls=IPython.terminal.debugger:TerminalPdb
--tb=short
# --cov=fls_sat_verif
# --mypy
# TODO add pydocstyle & mccabe
[tox]
envlist =
py37
flake8
pylint
mypy
requires =
tox-conda
conda_channels =
conda-forge
default
conda_env = requirements/dev-environment.yml
[testenv]
setenv =
PYTHONPATH = {toxinidir}
install_command =
pip install -U {opts} {packages}
conda_deps =
pytest
# pytest-cov
# pytest-mypy
commands = pytest --basetemp={envtmpdir} {posargs}
[testenv:flake8]
skip_install = true
conda_deps =
flake8
commands = flake8 src tests
[testenv:pylint]
conda_deps =
pylint
conda_install_args=
--file={toxinidir}/requirements/requirements.in
commands = pylint --rcfile=tox.ini src
[testenv:pre-commit]
skip_install = true
conda_deps =
pre-commit
commands = pre-commit run --all-files
[testenv:mypy]
skip_install = true
conda_deps =
mypy
# Note: Files in ./tests are currently not checked because they are not found
# Reason: Recursive file discovery in mypy is broken
# (https://github.com/python/mypy/issues/6385)
# Awaiting this to be released: https://github.com/python/mypy/pull/9636
commands = mypy --install-types --non-interactive src # tests