This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
generated from ONSdigital/ons-python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
92 lines (79 loc) · 2.24 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
[tool.poetry]
name = "streamlit-app"
version = "0.1.0"
description = "streamlit-app"
authors = ["evisos-ons"]
license = "MIT"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
[tool.poetry.group.dev.dependencies]
# :TODO: Remove pylint when ruff supports all pylint rules
# :TODO: Remove black when ruff supports all black rules
pylint = "^3.1.0"
black = "^24.4.1"
pytest = "^8.1.1"
pytest-xdist = "^3.5.0"
ruff = "^0.4.2"
pytest-cov = "^5.0.0"
mypy = "^1.10.0"
[tool.black]
line-length = 120
[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",
# Disable line length check as it is handled by black
# :TODO: Remove E501 when ruff supports all black rules
"E501",
# indentation contains tabs
"W191",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
# Allow use of assert statements in tests
"S101",
]
[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"