forked from opsmill/infrahub-demo-edge
-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
142 lines (126 loc) · 5.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
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
136
137
138
139
140
141
142
[tool.poetry]
name = "infrahub-demo-edge"
version = "0.1.0"
description = ""
authors = ["Damien Garros <[email protected]>"]
[tool.poetry.dependencies]
python = "^3.9, < 3.12"
infrahub-sdk = {version = "^1", extras = ["all"]}
invoke = "2.2.0"
[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
pytest = "^8.3.3"
ruff = "0.7.2"
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = [
"tests"
]
pythonpath = ["."]
[tool.ruff]
line-length = 120
exclude = [
".git",
".tox",
".venv",
"env",
"_build",
"build",
"dist",
"examples",
]
[tool.ruff.lint]
preview = true
task-tags = [
"FIXME",
"TODO",
"XXX",
]
select = [
"ASYNC", # flake8-async
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C90", # mccabe complexity
"DJ", # flake8-django
"DTZ", # flake8-datetimez
"E", # pycodestyle errors
"EXE", # flake8-executable
"F", # pyflakes
"I", # isort-like checks
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"N", # pep8-naming
"PIE", # flake8-pie
"PL", # pylint
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"TCH", # flake8-type-checking
"TRIO", # flake8-trio
"T10", # flake8-debugger
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
ignore = [
##################################################################################################
# The ignored rules below should be removed once the code has been updated, they are included #
# like this so that we can reactivate them one by one. Alternatively ignored after further #
# investigation if they are deemed to not make sense. #
##################################################################################################
"ASYNC101", # Async functions should not call `open`, `time.sleep`, or `subprocess` methods
"B007", # Loop control variable not used within loop body
"B008", # Do not perform function call `Depends` in argument defaults;
"B009", # [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access.
"B010", # [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access.
"B015", # Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it
"B018", # Found useless expression. Either assign it to a variable or remove it.
"B026", # Star-arg unpacking after a keyword argument is strongly discouraged
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
"C403", # Unnecessary `list` comprehension (rewrite as a `set` comprehension)
"C408", # Unnecessary `dict` call (rewrite as a literal)
"C409", # Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal)
"C414", # Unnecessary `list` call within `sorted()`
"C419", # Unnecessary list comprehension.
"N801", # Class name should use CapWords convention
"N802", # Function name should be lowercase
"N805", # First argument of a method should be named self
"N806", # Variable in function should be lowercase
"N811", # Constant imported as non-constant
"N812", # Lowercase imported as non-lowercase
"PIE804", # [*] Unnecessary `dict` kwargs
"PIE807", # Prefer `dict` over useless lambda
"PIE808", # [*] Unnecessary `start` argument in `range`
"PLC0415", # `import` should be at the top-level of a file
"PLC2701", # Private name import from external module
"PLR0904", # Too many public methods
"PLR0912", # Too many branches
"PLR0913", # Too many arguments in function definition
"PLR0914", # Too many local variables
"PLR0915", # Too many statements
"PLR0916", # Too many Boolean expressions
"PLR0917", # Too many positional arguments
"PLR1702", # Too many nested blocks
"PLR2004", # Magic value used in comparison this could possibly be fine in the tests folders
"PLR6201", # Use a `set` literal when testing for membership
"PLR6301", # Method could be a function, class method, or static method
"PLW0603", # Using the global statement to update `SETTINGS` is discouraged
"PLW1508", # Invalid type for environment variable default; expected `str` or `None`
"PLW2901", # `for` loop variable `path` overwritten by assignment target
"PLW3201", # Bad or misspelled dunder method name `__init_subclass_with_meta__`
]
#https://docs.astral.sh/ruff/formatter/black/
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint.isort]
known-first-party = ["infrahub"]
[tool.ruff.lint.pycodestyle]
max-line-length = 150
[tool.ruff.lint.mccabe]
# Target max-complexity=10
max-complexity = 33
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"