-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
113 lines (102 loc) · 3.32 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
[tool.ruff]
line-length = 120
target-version = 'py310'
extend-exclude = [
'*/migrations/*',
'*/templates/*',
'scripts/*',
'doc/conf.py',
]
[tool.ruff.lint]
select = ['ALL'] # https://docs.astral.sh/ruff/rules/
ignore = [
'A003', # Model fields shadowing builtins
'ANN', # Requires type annotation
'ARG002', # Unused function arguments
'B904', # Exception causes
'D', # Docstrings
'DJ001', # Do not allow nullable CharField
'DTZ', # Timezone aware datetimes
'EM', # String literals in exceptions
'FBT002', # Allow default boolean positional argument
'FIX', # Using FIXME/TODO/XXX comments
'ICN001', # Common package import alias
'PD', # Not using pandas
'PERF203', # Allow try/except in loop
'PLR0913', # Allow functions with many arguments
'PT', # Requires pytest
'RET', # Logic around return
'RUF012', # Requires type annotation
'S311', # Unsafe random generator for cryptographic purpose
'SIM108', # Requires ternary operator instead of if-else
'SLF001', # Using 'private' members, e.g. _v_name
'TD001', # Allow FIXME
'TD002', # Requires TODO author
'TD003', # Requires TODO issue link
'TID252', # Requires absolute imports
'TRY003', # Long messages for common exception classes
'TRY400', # Allow logger.error instead of logger.exception, message is clear and unique
# FIXME: The following should be 'easy' to fix
'A001', # Stop shadowing builtins with variables
'A002', # Stop shadowing builtins with arguments
'ARG001', # Functions with unused arguments
'B905', # Explicit value for strict in zip
'DJ008', # Create __str__ for all models
'PLR0911', # Reduce number of return statements
'PLR0912', # Reduce number of branches in function
'PLR0915', # Reduce number of statements in function
'PLR2004', # Assign 'magic numbers' via constant variables
'PLW2901', # Loop variable overwritten in loop
'PTH', # Should move from os.path to pathlib.Path
'S308', # Check if mark_safe is safe here
'S324', # Consider using different hash method
'TD', # Incorrectly formatted TODO
]
[tool.ruff.lint.per-file-ignores]
'publicdb/settings_develop.py' = ['S105'] # Hard coded SECRET_KEY for development
'publicdb/settings_docker.py' = ['F405'] # Star imports
# FIXME: The following should be fixable
'publicdb/inforecords/models.py' = ['S110', 'BLE001'] # Capture specific exceptions and handle it
'publicdb/histograms/jobs.py' = ['BLE001'] # Capture specific exceptions and handle it
[tool.ruff.lint.isort]
lines-between-types = 1
section-order = [
'future',
'standard-library',
'third-party',
'django',
'sapphire',
'first-party',
'tests',
'local-folder',
]
[tool.ruff.lint.isort.sections]
django = ['django']
sapphire = ['sapphire']
tests = ['tests']
[tool.ruff.lint.mccabe]
max-complexity = 18
[tool.ruff.lint.flake8-quotes]
inline-quotes = 'single'
[tool.ruff.format]
quote-style = 'single'
[tool.coverage.run]
branch = true
source = [
'publicdb',
'tests',
]
omit = [
'*/migrations/*',
'publicdb/settings.py',
]
[tool.coverage.report]
show_missing = true
skip_empty = true
skip_covered = true
[tool.typos.files]
extend-exclude = [
'publicdb/default/static/scripts/',
]
[tool.typos.default.extend-words]
sur = 'sur'