-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathpyproject.toml
More file actions
99 lines (85 loc) · 2.41 KB
/
Copy pathpyproject.toml
File metadata and controls
99 lines (85 loc) · 2.41 KB
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
[project]
name = "ons-python-template"
version = "0.1.0"
description = "A Python starter template designed to jump start your next Python project"
readme = "README.md"
license = "MIT"
authors = [{ name = "ONSdigital" }]
requires-python = ">=3.11"
dynamic = ["dependencies"]
[tool.poetry]
package-mode = false
[tool.poetry.dependencies]
python = "^3.11"
copier = "^9.17.1"
[tool.poetry.group.dev.dependencies]
pre-commit = "^4.6.1"
# :TODO: Remove pylint when ruff supports all pylint rules
pylint = "^4.0.6"
pytest = "^9.1.1"
pytest-xdist = "^3.8.0"
ruff = "^0.16.1"
pytest-cov = "^7.1.0"
mypy = "^2.3.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length = 120
indent-width = 4
[tool.ruff.lint]
select = [
# Enabling ALL is not recommended it will implicitly enable new rules after upgrade.
# "ALL",
# Ruff rules: https://docs.astral.sh/ruff/rules/
"E", # pycodestyle erros
"W", # pycodestyle warnings
"F", # Pyflakes
"UP", # pyupgrade
"I", # isort
"B", # flake8-bugbear
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
"S", # flake8-bandit
"D", # pydocstyle - Enforce existing docstrings only
"C90", # mccabe
"RUF", # Ruff specific rules
# PL - Pylint is only partially supported, we also use the pylint tool to catch all the rules.
# It is enabled here to take advantage of the ruff's speed.
"PL",
]
ignore = [
# Conflicts with google docstring style
"D205",
# Allow missing docstring, remove to enforce docstrings across the board
"D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107",
# indentation contains tabs
"W191",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"**/tests/**/*.py" = [
# Allow use of assert statements in tests
"S101",
# Allow subprocess use in test harness helpers
"S603",
# Allow localized imports inside tests
"PLC0415",
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
# Global mypy options
no_implicit_optional = "True"
ignore_missing_imports = "True"
warn_unused_configs = "True"
warn_no_return = "False"
warn_unused_ignores = "True"
warn_return_any = "True"
warn_redundant_casts = "True"
disallow_untyped_defs = "True"
disallow_untyped_calls = "True"
disallow_incomplete_defs = "True"
strict_equality = "True"