-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
156 lines (146 loc) · 4.37 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
[tool.poetry]
name = "crypto-fifo-taxes"
version = "0.1.0"
description = ""
authors = ["Eemeli Ranta <[email protected]>"]
[tool.poetry.dependencies]
python = "^3.12"
Django = "^5.0.2"
django-environ = "^0.11.2"
dj-database-url = "^2.1.0"
Pillow = "^10.2.0"
psycopg2 = "^2.9.1"
requests = "^2.31.0"
python-binance = "^1.0.19"
reportlab = "^4.1.0"
django-enumfields2 = "^3.0.2"
[tool.poetry.group.dev.dependencies]
pytest = "^8.0.1"
pytest-cov = "^4.1.0"
pytest-django = "^4.8.0"
factory-boy = "^3.3.0"
ruff = "^0.2.2"
bandit = "^1.7.7"
freezegun = "^1.4.0"
[tool.poetry.group.lint.dependencies]
pre-commit = "^3.6.1"
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "project.settings"
python_files = [
"tests.py",
"test_*.py",
"*_tests.py",
]
norecursedirs = [
".git",
"venv",
"build",
]
[tool.ruff]
fix = true
line-length = 120
target-version = "py312"
extend-exclude = [
"migrations",
"venv",
"build",
"api/examples.py",
"tilavarauspalvelu/settings.py",
"local_settings.py",
]
lint.select = [
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"UP", # pyupgrade
"PL", # pylint
"TRY", # tryceratops
"ISC", # flake8-implicit-str-concat
"S", # flake8-bandit
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"T20", # flake8-print
"TID", # flake8-tidy-imports
"PT", # flake8-pytest-style
"RSE", # flake8-raise
"SIM", # flake8-simplify
"DJ", # flake8-django
"LOG", # flake8-logging
"PIE", # flake8-pie
"RUF", # ruff-specific rules
"RET502", # flake8-return: Do not implicitly return None in function able to return non-None value
"RET503", # flake8-return: Missing explicit return at the end of function able to return non-None value
"D200", # pydocstyle: One-line docstring should fit on one line
"D201", # pydocstyle: No blank lines allowed before function docstring (found {num_lines})
"D202", # pydocstyle: No blank lines allowed after function docstring (found {num_lines})
"D209", # pydocstyle: Multi-line docstring closing quotes should be on a separate line
"D213", # pydocstyle: Multi-line docstring summary should start at the second line
]
lint.ignore = [
"S101", # assert is fine
"S311", # pseudo-random generators are fine
"B904", # bare raise is fine
"B905", # zip without strict
# Conflicting with ruff-format
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"D206", # indent-with-spaces
"D300", # triple-single-quotes
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
"Q000", # bad-quotes-inline-string
"Q001", # bad-quotes-multiline-string
"Q002", # bad-quotes-docstring
"Q003", # avoidable-escaped-quote
"W191", # tab-indentation
"RUF012", # mutable-class-default
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR2004", # magic-value-comparison
"PLW2901", # redefined-loop-name
"TRY003", # raise-vanilla-args
]
[tool.ruff.lint.extend-per-file-ignores]
"common/management/commands/create_test_data.py" = [
"S311", # pseudo-random generators are fine here.
]
"common/management/commands/_utils.py" = [
"S311", # pseudo-random generators are fine here.
]
"test_*.py" = [
"S105", # Hardcoded passwords are fine in tests
"S106", # Hardcoded passwords are fine in tests
"S108", # No need to care about insecure temp file usages in tests
"S311", # Pseudo-random generators are fine here.
]
[tool.ruff.lint.isort]
combine-as-imports = false
known-third-party = [
"django",
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.bandit]
exclude_dirs = [
"tests",
]
skips = [
"B101", # Assert is fine.
"B311", # Random is fine.
]
[tool.coverage.run]
omit = [
"*migrations*",
"*tests*",
]
exclude_also = [
"if TYPE_CHECKING:",
"def __repr__",
"def __str__",
]