-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
100 lines (86 loc) · 2.33 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
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
[project]
name = "glauth-k8s-operator"
version = "0.1.0"
description = "A Charmed Operator for running GLAuth on Kubnernetes"
requires-python = ">=3.8"
readme = "README.md"
license = {file = "LICENSE"}
dynamic = ["version"]
# 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/glauth_k8s/**/*.py"]
extend-exclude = ["__pycache__", "*.egg_info"]
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 = 10
[tool.ruff.lint.pydocstyle]
convention = "google"
# Type checking tools configuration
[tool.mypy]
pretty = true
mypy_path = "./src:./lib/:./tests"
# Exclude non-glauth libraries
exclude = 'lib/charms/((?!glauth_k8s/).)'
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
disable_error_code = "attr-defined"
ignore_missing_imports = true
# Ignore libraries that do not have type hint nor stubs
[[tool.mypy.overrides]]
module = ["ops.*", "pytest.*", "pytest_operator.*", "urllib3.*", "jinja2.*", "lightkube.*", "pytest_mock.*"]