-
Notifications
You must be signed in to change notification settings - Fork 7
/
pyproject.toml
109 lines (84 loc) · 3.48 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
[tool.ruff]
line-length = 120
[tool.ruff.lint]
# Enable ALL Pyflakes codes by default.
select = ["ALL"]
extend-ignore = [
"C408", # Unnecessary <dict/list/tuple> call - rewrite as a literal. Disagree with this.
# Arguments
"ARG001", # Unusued argument
# Annotations not required
"ANN101", # Missing type annotation for `self` in method
"ANN002", # Missing type annotation for `*args`
"ANN003", # Missing type annotation for `**kwargs`
"ANN204", # Missing return type annotation for special method `__init__`
# Docstrings
"D100", # Missing docstring in public module.
"D101", # don't require docstrings everywhere.
"D107",
"D202",
"D203",
"D205", # KGD: added this: the style of starting immediately is tough to read
"D212",
"D213",
"D402",
"D405", # Section name should be properly capitalized ("RETURN"): confused with Cypher queries
"D407", # Missing dashed underline after section ("RETURN"): confused with Cypher queries
"D413",
"D415",
"D416",
"D417",
"N803", # we don't mind mixed case variable names
"N806", # we don't mind mixed case variable names
"RET505", # Unnecessary `else` after `return` statement. Not convinced this is bad style.
# Pandas:
"PD011", # Don't agree that .values is bad style.
"PD901", # Don't agree that df is a bad variable name.
# Commented out code
"ERA001", # This is tough-one: commented out code does have its uses in debugging/testing
# Boolean traps. I don't necessarily agree that these are traps in Python.
"FBT001",
"FBT002",
"FBT003",
# Controversial: but let's exclude assert testing. It is useful for unit testing,
# and disabling ruff on all files that start with `**/*test_*.py` means many other useful
# checks are disabled.
"S101", # Use of assert detected.
# Testing
"TID252", # we do need relative imports for the unit tests
# Refactoring
"PLR2004", # Don't agree that this is a bad style. It leads to overly verbose code in many cases.
# Stop it with the trailing commas.
"COM812", # Trailing comma is not always needed - doesn't lead to more readable code.
# Ignore certain flake8-type-checking (TCH) codes.
"TCH001", # Don't agree that this is a bad style. It leads to overly verbose code.
"TCH002", # Don't agree that this is a bad style. It leads to overly verbose code.
"TCH003", # Don't agree that this is a bad style. It leads to overly verbose code.
# Access private functions.
"SLF001", # Sometimes we need to access private functions
# Don't require that Exceptions have string literals
"EM101", # Ugly redundant code otherwise
# Issues and TODO
"TD002", # Not necessary that every todo has a username,
"TD003", # Not necessary that every todo has an issuelink
"TD004", # Not necessary that every todo has a colon
"TD005", # Not necessary that every todo has a description
"FIX002", # Not necessary that every fixme has to be removed
# OK to use f-strings in errors as far as we are concerned here
"TRY003",
"EM102",
]
# Exclude a variety of commonly ignored directories.
exclude = [
".git",
".mypy_cache",
".ruff_cache",
"__pypackages__",
#"**/*test_*.py",
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.isort]
known-third-party=["pytest", "pandas"]