-
Notifications
You must be signed in to change notification settings - Fork 90
/
pyproject.toml
136 lines (127 loc) · 2.54 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
[project]
name = "Ion"
description = "The next-generation Intranet platform for TJHSST"
readme = "README.rst"
authors = [
{name = "The TJHSST Computer Systems Lab", email = "[email protected]"}
]
requires-python = ">=3.8"
version = "1.0"
dynamic = ["dependencies"]
license = { text = "GPLv2+" }
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.8",
"Framework :: Django :: 3.2",
]
[project.urls]
Repository = "https://github.com/tjcsl/ion"
[tool.setuptools]
packages = ["intranet", "migrations"]
[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}
[tool.black]
line-length = 150
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| media
| migrations
| secret.*
| stubs
)/
'''
[tool.ruff]
extend-exclude = [
"Ion.egg-info",
"build",
".env",
"env",
"migrations",
]
# show fixes made in stdout
# show-fixes = true
line-length = 150
target-version = "py38"
[tool.ruff.lint]
select = [
# flake8-bugbear
"B",
# flake8-comprehensions
"C4",
# flake8-django
"DJ",
# pycodestyle
"E",
# Pyflakes
"F",
# isort
"I",
# flake8-no-pep420
"INP",
# Pylint
"PL",
# ruff
"RUF",
# pyupgrade
"UP",
]
ignore = [
# default arguments for timezone.now()
"B008",
# null=True on CharField/TextField
"DJ001",
# No __str__ method on Model
"DJ008",
# Django order of model methods
"DJ012",
# ambiguous variable name
"E741",
# as recommended by https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"E111",
"E114",
"E117",
"E501",
# branching
"PLR09",
# avoid magic numbers
"PLR2004",
# loop variables overwritten by assignment
"PLW2901",
# Use ternary operator (x if cond else y)
"RUF005",
# mutable class attrs annotated as typing.ClassVar
"RUF012",
# implicit Optional
"RUF013",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401",
"F403",
]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
parametrize-names-type = "tuple"
parametrize-values-type = "tuple"
[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
[tool.codespell]
write-changes = true
skip = "*.pyi,*/vendor,*/migrations,*media"
ignore-words-list = "num,ans,intranet,ther,usera,userb"
# match: # codespell: ignore
ignore-regex=".+# *codespell: *ignore"