Debian Codegraph @

ansible_collections/community/proxmox/ruff.toml

raw
1 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
2 # SPDX-License-Identifier: GPL-3.0-or-later
3 # SPDX-FileCopyrightText: 2025 Felix Fontein <[email protected]>
4
5 line-length = 120
6 target-version = "py37"
7
8 [lint]
9 # https://docs.astral.sh/ruff/rules/
10
11 select = ["A", "B", "D", "E", "F", "FA", "FLY", "UP", "SIM", "I", "RUF022", "PL"]
12 ignore = [
13 # Better keep ignored (for now)
14 "F811", # Redefinition of unused `xxx` (happens a lot for fixtures in unit tests)
15 "E402", # Module level import not at top of file
16 "E741", # Ambiguous variable name
17 "UP012", # unnecessary-encode-utf8
18 "UP015", # Unnecessary mode argument
19 "SIM105", # suppressible-exception
20 "SIM108", # if-else-block-instead-of-if-exp
21 "D100", # Missing docstring in public module
22 "D107", # undocumented-public-init
23 "D203", # incorrect-blank-line-before-class, mutually exclusive to D211
24 "D212", # multi-line-summary-first-line, mutually exclusive to D213
25 ]
26
27 # Allow fix for all enabled rules (when `--fix`) is provided.
28 fixable = ["ALL"]
29 unfixable = []
30
31 # Allow unused variables when underscore-prefixed or starting with dummy
32 dummy-variable-rgx = "^(_|dummy).*$"
33
34
35 [lint.per-file-ignores]
36 # Only require docstrings for shared utils
37 "!**/*_utils/*.py" = ["D"]
38
39 [lint.pydocstyle]
40 # force users to include their variables in docstrings to improve editor support
41 ignore-var-parameters = false
42 # quite similar to the yaml we already use as ansible documentation
43 convention = "google"
44
45
46 [lint.isort]
47 # The resulting order is: stdlib, third-party, e.g. ansible, first-party, e.g. ansible_collections.community.proxmox.*, local
48 known-first-party = [
49 "ansible_collections.community.proxmox",
50 ]
51 known-third-party = [
52 "ansible_collections.community.internal_test_tools",
53 ]
54
55 [lint.pycodestyle]
56 max-line-length = 160
57
58 [format]
59 # https://docs.astral.sh/ruff/formatter/#configuration
60 # Like Black, use double quotes for strings.
61 quote-style = "double"
62
63 # Like Black, indent with spaces, rather than tabs.
64 indent-style = "space"
65
66 # Like Black, respect magic trailing commas.
67 skip-magic-trailing-comma = false
68
69 line-ending = "lf"
70
71 # Disable auto-formatting of code examples in docstrings. Markdown,
72 # reStructuredText code/literal blocks and doctests are all supported.
73 docstring-code-format = false
74
75