This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
109 lines (95 loc) · 3.68 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
# `flake8` does not support pyproject.toml as of 2021/09/11.
# ************************************************************
# -------------------------- pylint --------------------------
[tool.pylint.BASIC]
# Reason of the good names:
# - _
# often used as dummy variable during unpacking
# - T
# often used to for TypeVar
# - f
# often used as a file stream name
# - i, j, k
# often used in for loops
# - s
# often used to represent "string"
# - v
# often used to represent "value"
# - dt, tz
# often used in datetime handling (dt for datetime, tz for timezone)
# - ex
# often used as the var name of exception caught by try..except
# - hp
# simply means HP (hit point)
# - fn
# often used to represent a function address
good-names = "_,T,f,i,j,k,s,v,dt,ex,hp,fn,tz"
[tool.pylint.DESIGN]
# Some classes expected to inherit from many base classes. For example, character data entry.
max-parents = 15
max-args = 10
[tool.pylint.FORMAT]
max-line-length = 119
[tool.pylint."MESSAGES CONTROL"]
# fixme: Search for todo tags and manually manage them instead
# too-many-instance-attributes: Data class usually will have a lot of attributes which should not be grouped
# cyclic-import: Just let it crash during runtime
# arguments-differ: Let it checked by IDE or flake8
disable = "fixme, too-many-instance-attributes, cyclic-import, arguments-differ"
# -------------------------- pydocstyle --------------------------
[tool.pydocstyle]
# D102: Public method missing docstring - `pylint` will check if there's really missing the docstring
# D105: Magic method missing docstring - no need for it
# D107: __init__ missing docstring - optional. add details to class docstring
# D203: Blank line required before docstring - mutually exclusive to D204
# D212: Multi-line docstring summary should start at the first line - mutually exclusive to D213
# D215: Section underline is over-indented
# D401: First line should be in imperative mood
# D404: First word of the docstring should not be This
# D406: Section name should end with a newline
# D407: Missing dashed underline after section
# D408: Section underline should be in the line following the section's name
# D409: Section underline should match the length of its name
# D412: No blank lines allowed between a section header and its content
# D413: Missing blank line after last section
ignore = "D102, D105, D107, D203, D212, D215, D401, D404, D406, D407, D408, D409, D412, D413"
# -------------------------- coverage --------------------------
# Doc: https://coverage.readthedocs.io/en/stable/config.html
[tool.coverage.run]
# More precise result as this checks for the branch coverage
# Doc: https://coverage.readthedocs.io/en/stable/branch.html#branch
branch = true
# Files to be included.
source = ["dlparse/"]
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# debug-only
"def __repr__",
# ABC implementations
"raise NotImplementedError"
]
# Coverage percentage precision
precision = 2
# Emits exit code 2 if the coverage is below the threshold
fail_under = 80
[tool.coverage.xml]
output = "cobertura.xml"
# -------------------------- pytest --------------------------
# Check `/notes/others/CodeTests.md` for more details about the markers.
[tool.pytest.ini_options]
# slow: Test that is expected to be slow.
# holistic: Test that performs holistic check(s).
markers = [
"slow",
"holistic"
]
# -------------------------- mypy --------------------------
[tool.mypy]
follow_imports = "skip"
exclude = "(tests/|script_*)"
show_error_codes = true
disable_error_code = "misc"
disallow_untyped_defs = true
disallow_untyped_decorators = true
disallow_any_expr = true