Skip to content

Commit fd34db7

Browse files
committed
linting
1 parent c27644d commit fd34db7

File tree

6 files changed

+121
-30
lines changed

6 files changed

+121
-30
lines changed

pyproject.toml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,31 @@ exclude = ["*_v?.py", "tests", "scripts", "sample_extension", ".git"]
3636

3737
[tool.ruff.lint]
3838
fixable = ["ALL"]
39-
ignore = ["E203", "D107", "D105"]
4039
select = [
4140
# pycodestyle
42-
"E",
41+
"E", # error
42+
"W", # warn
43+
# builtins
44+
"A",
45+
# bugbear
46+
"B",
47+
# comprehensions
48+
"C",
49+
# err msg
50+
"EM",
51+
# str concat
52+
"ISC",
53+
# import conventions
54+
"ICN",
55+
# flake8 log
56+
"G",
57+
"LOG",
58+
# pep8 naming
59+
"D",
60+
# pydocstyle
4361
"D",
62+
# mccabe
63+
"C",
4464
# Pyflakes
4565
"F",
4666
# pyupgrade
@@ -51,8 +71,37 @@ select = [
5171
"SIM",
5272
# isort
5373
"I",
54-
"W"
74+
# flake-2020
75+
"YTT",
76+
# flake-annotations
77+
"ANN",
78+
# flake-async
79+
"ASYNC",
80+
# flake-blind-except
81+
"BLE",
82+
# flake-boolean-trap
83+
"FBT",
84+
# pytest
85+
"PT",
86+
# self
87+
"SLF",
88+
# tidy-imports
89+
"TID",
90+
# type checking
91+
"TCH",
92+
# unused arg
93+
"ARG",
94+
# pathlib
95+
"PTH",
96+
# pylint
97+
"PL",
98+
# perflnt
99+
"PERF",
100+
# ruf
101+
"RUF",
55102
]
103+
ignore = ["ANN201", "ANN001", "ANN002", "ANN202", "ARG002", "PLR", "C", "FBT002", "D107", "ANN204", "D"]
104+
56105
[tool.ruff.format]
57106
indent-style = "space"
58107
line-ending = "auto"

src/wlr_layout_ui/displaywidget.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Screen widgets for the display manager."""
2+
13
import random
24

35
from pyglet.shapes import BorderedRectangle
@@ -11,12 +13,15 @@
1113

1214

1315
def limit_size(text):
16+
"""Limit the size of the text to 15 characters."""
1417
if len(text) > 15:
1518
return text[:12] + "..."
1619
return text
1720

1821

1922
class GuiScreen(Widget):
23+
"""A widget representing a screen."""
24+
2025
def __repr__(self):
2126
return f"<Screen {self.rect} ({self.color}) - {self.screen.name}>"
2227

@@ -56,7 +61,7 @@ def genColor(self):
5661
255,
5762
)
5863
else:
59-
self.color = list(self.all_colors[self.cur_color]) + [255]
64+
self.color = [*list(self.all_colors[self.cur_color]), 255]
6065
GuiScreen.cur_color += 1
6166
self.drag_color = list(self.color)
6267
self.drag_color[-1] = 200

0 commit comments

Comments
 (0)