-
Notifications
You must be signed in to change notification settings - Fork 14
/
pyproject.toml
135 lines (115 loc) · 4.21 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
[tool.pytest.ini_options]
addopts = "-q"
filterwarnings = [
"error", # Fail the tests if there are any warnings.
"ignore:^find_module\\(\\) is deprecated and slated for removal in Python 3.12; use find_spec\\(\\) instead$:DeprecationWarning:importlib",
"ignore:^FileFinder.find_loader\\(\\) is deprecated and slated for removal in Python 3.12; use find_spec\\(\\) instead$:DeprecationWarning:importlib",
"ignore:^pkg_resources is deprecated as an API:DeprecationWarning:pkg_resources",
"ignore:^pkg_resources is deprecated as an API:DeprecationWarning:pyramid",
"ignore:^Deprecated call to .pkg_resources\\.declare_namespace\\('.*'\\).\\.:DeprecationWarning:pkg_resources",
"ignore:^'cgi' is deprecated and slated for removal in Python 3\\.13$:DeprecationWarning:webob",
]
[tool.coverage.run]
branch = true
parallel = true
source = ["lms", "tests/unit"]
omit = [
"*/lms/__main__.py",
"*/lms/scripts/init_db.py",
"lms/pshell.py",
"lms/migrations/*",
"lms/extensions/feature_flags/views/test.py",
"lms/views/feature_flags_test.py",
]
[tool.coverage.paths]
source = ["src", ".tox/*tests/lib/python*/site-packages"]
[tool.coverage.report]
show_missing = true
precision = 2
fail_under = 100.00
skip_covered = true
exclude_also = [
# # TYPE_CHECKING block is only executed while running mypy
"if TYPE_CHECKING:"
]
[tool.ruff]
target-version = "py311"
line-length = 88
exclude = [
"tests/bdd/steps/_compiled_feature_steps.py",
]
[tool.ruff.lint]
select = [
"E", "W", # https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"BLE001", # https://docs.astral.sh/ruff/rules/blind-except/
"R", "PLR", # https://docs.astral.sh/ruff/rules/#refactor-r
"C", "PLC", # https://docs.astral.sh/ruff/rules/#convention-c
"SLF", # flake-8-self
"N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n
"RUF100", # unused-noqa
]
ignore = [
# Missing docstrings.
"D100","D101","D102","D103","D104","D105","D106","D107",
# "No blank lines allowed after function docstring" conflicts with the
# Black code formatter which insists on inserting blank lines after
# function docstrings.
"D202",
# "1 blank line required before class docstring" conflicts with another
# pydocstyle rule D211 "No blank lines allowed before class docstring".
"D203",
# "Multi-line docstring summary should start at the first line"
# and "Multi-line docstring summary should start at the second line".
# These two rules conflict with each other so you have to disable one of them.
# How about we disable them both? PEP 257 says either approach is okay:
#
# > The summary line may be on the same line as the opening quotes or on
# > the next line.
# >
# > https://peps.python.org/pep-0257/#multi-line-docstrings
"D212",
"D213",
# We use Black to format our code automatically, so we don't need PyLint to
# check formatting for us.
"E501", # line-too-long
"PLR2004", # Magic values, we mostly get it on HTTP status codes
# Disabled during the pylint migration, ideally we'll enable this after we are settled in ruff
"RET504",
"RET501",
"PLR6301",
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
# Just disable name style checking for the tests, because we
# frequently use lots of argument names that don't conform.
# For example we frequently create pytest fixtures that aren't named in
# snake_case, such as a fixture that returns a mock of the FooBar class would
# be named FooBar in CamelCase.
"N",
# We are more lax about comment formatting in the tests
"D",
"PLR0913",
# Lots of test methods don't use self, but we still want to group our tests
# into classes.
"PLR6301",
"PLR0917", # too-many-arguments
"PLC2701", # private import
"PLR0904", # too-many-public-methods
]
[tool.mypy]
python_version = 3.11
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
check_untyped_defs = true
disable_error_code = [
"import-untyped",
]
[[tool.mypy.overrides]]
module= [
"tests.*",
"lms.migrations.*"
]
ignore_errors = true