summaryrefslogtreecommitdiff
path: root/.ruff.toml
diff options
context:
space:
mode:
authorSimeon Simeonov2025-12-23 21:24:30 +0100
committerSimeon Simeonov2025-12-23 21:24:30 +0100
commit3faee283f3e56f046e106fff5330a756a949618d (patch)
tree3e5fbe91f70030f577b5012dd85c5a1a2ba4ccb5 /.ruff.toml
parenta29c4509a316c0c77450b6fa74b96f036b0f0821 (diff)
Improve layout and add ruff configuration
Diffstat (limited to '.ruff.toml')
-rw-r--r--.ruff.toml98
1 files changed, 98 insertions, 0 deletions
diff --git a/.ruff.toml b/.ruff.toml
new file mode 100644
index 0000000..956737c
--- /dev/null
+++ b/.ruff.toml
@@ -0,0 +1,98 @@
1cache-dir = "~/.cache/ruff"
2indent-width = 4
3line-length = 79
4target-version = "py314"
5
6[lint]
7select = ["ALL", "D101", "D102", "D103", "D104"]
8ignore = [
9 "ANN",
10 "BLE001",
11 "COM812",
12 "D",
13 "EM101", # Exception must not use a string literal, assign to variable first
14 "EM102", # Exception must not use an f-string literal, assign to variable first
15 "ERA001",
16 #"FBT001",
17 #"FBT002",
18 #"INP001",
19 #"ISC001",
20 #"N802",
21 #"N806",
22 #"PLR2004",
23 # "PTH111",
24 # "PTH123",
25 "RUF012",
26 #"RUF013",
27 #"S101",
28 "S308",
29 #"T201",
30 "TRY003",
31 "TRY300",
32 #"UP020"
33]
34
35# C901 - `outside_temperature` is too complex (12 > 10)
36# D101 - Missing docstring in public class
37# D102 - Missing docstring in public method
38# D200 - One-line docstring should fit on one line
39# D203 - 1 blank line required before class docstring
40# D205 - 1 blank line required between summary line and description
41# D403 - First word of the first line should be capitalized: `str` -> `Str`
42# ERA001 - Found commented-out code
43# FBT001 - Boolean-typed positional argument in function definition
44# FBT002 - Boolean default positional argument in function definition
45# INP001 - File `beinc_weechat.py` is part of an implicit namespace package. Add an `__init__.py`
46# N802 - Function name `do_GET` should be lowercase
47# N806 - Variable `POST_data` in function should be lowercase
48# PTH111 - `os.path.expanduser()` should be replaced by `Path.expanduser()`
49# PTH123 - `open()` should be replaced by `Path.open()`
50# PLR0912 - Too many branches (13 > 12)
51# PLR0913 - Too many arguments in function definition (6 > 5)
52# PLR2004 - Magic value used in comparison, consider replacing `200` with a constant variable
53# RUF012 - Mutable class attributes should be annotated with `typing.ClassVar`
54# RUF013 - PEP 484 prohibits implicit `Optional`
55# S101 - Use of `assert` detected
56# S308 - Use of `mark_safe` may expose cross-site scripting vulnerabilities
57# S603 - `subprocess` call: check for execution of untrusted input
58# T201 - `print` found
59# TRY003 - Avoid specifying long messages outside the exception class
60# TRY300 - Consider moving this statement to an `else` block
61# UP020 - Use builtin `open`
62
63# Allow fix for all enabled rules (when `--fix`) is provided.
64fixable = ["ALL"]
65unfixable = []
66
67[format]
68# Like Black, use double quotes for strings.
69quote-style = "single"
70
71# Like Black, indent with spaces, rather than tabs.
72indent-style = "space"
73
74# Like Black, respect magic trailing commas.
75skip-magic-trailing-comma = true
76
77# Like Black, automatically detect the appropriate line ending.
78line-ending = "lf"
79
80# Enable auto-formatting of code examples in docstrings. Markdown,
81# reStructuredText code/literal blocks and doctests are all supported.
82#
83# This is currently disabled by default, but it is planned for this
84# to be opt-out in the future.
85docstring-code-format = false
86
87# Set the line length limit used when formatting code snippets in
88# docstrings.
89#
90# This only has an effect when the `docstring-code-format` setting is
91# enabled.
92docstring-code-line-length = "dynamic"
93
94[lint.flake8-quotes]
95inline-quotes = "single"
96
97[lint.isort]
98split-on-trailing-comma = false