-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
89 lines (77 loc) · 2.12 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
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
# Testing tools configuration
[tool.coverage.run]
branch = true
[tool.coverage.report]
show_missing = true
[tool.pytest.ini_options]
minversion = "6.0"
log_cli_level = "INFO"
# Linting and formatting tools configuration
[tool.codespell]
# https://github.com/codespell-project/codespell
skip = ".git,.tox,build,lib,venv,.venv,.mypy_cache,icon.svg,__pycache__"
[tool.isort]
# Profiles: https://pycqa.github.io/isort/docs/configuration/profiles.html
line_length = 99
profile = "black"
[tool.ruff]
# Default settings: https://docs.astral.sh/ruff/configuration/
# Settings: https://docs.astral.sh/ruff/settings/
line-length = 99
include = ["pyproject.toml", "src/**/*.py", "tests/**/*.py", "lib/charms/kratos/**/*.py"]
extend-exclude = ["__pycache__", "*.egg_info", "tests/unit/capture_events.py"]
target-version = "py38"
preview = true
[tool.ruff.lint]
# Rules: https://docs.astral.sh/ruff/rules/
select = ["E", "W", "F", "C", "N", "D", "CPY"]
ignore = [
"D100",
"D101",
"D102",
"D103",
"D105",
"D107",
"D203",
"D204",
"D213",
"D215",
"D400",
"D404",
"D406",
"D407",
"D408",
"D409",
"D413",
"E501",
"N818"
]
per-file-ignores = {"tests/*" = ["D100","D101","D102","D103","D104"]}
[tool.ruff.lint.flake8-copyright]
author = "Canonical Ltd."
[tool.ruff.lint.mccabe]
max-complexity = 15 # accommodate holistic handler needs
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.mypy]
pretty = true
mypy_path = "./src:./lib/:./tests"
# Exclude non-kratos libraries
exclude = 'lib/charms/((?!kratos/).)'
follow_imports = "silent"
warn_redundant_casts = true
warn_unused_configs = true
show_traceback = true
show_error_codes = true
namespace_packages = true
explicit_package_bases = true
check_untyped_defs = true
allow_redefinition = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
# Ignore libraries that do not have type hint nor stubs
[[tool.mypy.overrides]]
module = ["ops.*", "pytest.*", "pytest_operator.*", "urllib3.*", "jinja2.*", "lightkube.*", "pytest_mock.*"]
ignore_missing_imports = true