Skip to content

Commit 8e98f25

Browse files
committed
linting
1 parent 64c18c3 commit 8e98f25

6 files changed

Lines changed: 18 additions & 14 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ max-complexity = 12
123123
max-line-length = 127
124124
select = ["E", "F", "W", "C90"]
125125
extend-ignore = ["E203", "E266", "E502", "W503"]
126-
per-file-ignores = ["__init__.py:F403,F405"]
126+
per-file-ignores = ["__init__.py:F403,F405", "types.py:E302,E305"]
127127

128128
[tool.setuptools]
129129
package-dir = { "" = "src" }

src/xulbux/color.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ def is_valid_rgba(cls, color: AnyRgba, /, *, allow_alpha: bool = True) -> bool:
799799
and len(array_color) == 4
800800
and all(isinstance(val, int) for val in array_color[:3])
801801
and isinstance(array_color[3], (float, type(None)))
802-
):
802+
):
803803
return (
804804
0 <= array_color[0] <= 255 and 0 <= array_color[1] <= 255 and 0 <= array_color[2] <= 255
805805
and (array_color[3] is None or 0 <= array_color[3] <= 1)
@@ -816,7 +816,7 @@ def is_valid_rgba(cls, color: AnyRgba, /, *, allow_alpha: bool = True) -> bool:
816816
and len(dict_color) == 4
817817
and all(isinstance(dict_color.get(ch), int) for ch in ("r", "g", "b"))
818818
and isinstance(dict_color.get("a", "no alpha"), (float, type(None)))
819-
):
819+
):
820820
return (
821821
0 <= dict_color["r"] <= 255 and 0 <= dict_color["g"] <= 255 and 0 <= dict_color["b"] <= 255
822822
and (dict_color["a"] is None or 0 <= dict_color["a"] <= 1)
@@ -850,7 +850,7 @@ def is_valid_hsla(cls, color: AnyHsla, /, *, allow_alpha: bool = True) -> bool:
850850
and len(array_color) == 4
851851
and all(isinstance(val, int) for val in array_color[:3])
852852
and isinstance(array_color[3], (float, type(None)))
853-
):
853+
):
854854
return (
855855
0 <= array_color[0] <= 360 and 0 <= array_color[1] <= 100 and 0 <= array_color[2] <= 100
856856
and (array_color[3] is None or 0 <= array_color[3] <= 1)
@@ -867,7 +867,7 @@ def is_valid_hsla(cls, color: AnyHsla, /, *, allow_alpha: bool = True) -> bool:
867867
and len(dict_color) == 4
868868
and all(isinstance(dict_color.get(ch), int) for ch in ("h", "s", "l"))
869869
and isinstance(dict_color.get("a", "no alpha"), (float, type(None)))
870-
):
870+
):
871871
return (
872872
0 <= dict_color["h"] <= 360 and 0 <= dict_color["s"] <= 100 and 0 <= dict_color["l"] <= 100
873873
and (dict_color["a"] is None or 0 <= dict_color["a"] <= 1)

src/xulbux/data.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -791,12 +791,19 @@ def __init__(
791791

792792
punct_map: dict[str, str | tuple[str, str]] = {"(": ("/(", "("), **{c: c for c in "'\":)[]{}"}}
793793
self.punct: dict[str, str] = {
794-
key: ((
795-
f"{self.syntax_hl['punctuation'][0]}{val[0]}{self.syntax_hl['punctuation'][1]}"
796-
if self.do_syntax_hl else val[1]
797-
) if isinstance(val, (list, tuple)) else
798-
(f"{self.syntax_hl['punctuation'][0]}{val}{self.syntax_hl['punctuation'][1]}" if self.do_syntax_hl else val))
799-
for key, val in punct_map.items()
794+
key: (
795+
(
796+
f"{self.syntax_hl['punctuation'][0]}{val[0]}{self.syntax_hl['punctuation'][1]}" \
797+
if self.do_syntax_hl
798+
else val[1]
799+
) \
800+
if isinstance(val, (list, tuple))
801+
else (
802+
f"{self.syntax_hl['punctuation'][0]}{val}{self.syntax_hl['punctuation'][1]}" \
803+
if self.do_syntax_hl
804+
else val
805+
)
806+
) for key, val in punct_map.items()
800807
}
801808

802809
def __call__(self) -> str:

src/xulbux/format_codes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ def remove(
380380
) -> str:
381381
...
382382

383-
384383
@overload
385384
@classmethod
386385
def remove(

tests/test_console.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
@pytest.fixture
1616
def mock_terminal_size(monkeypatch: pytest.MonkeyPatch):
1717

18-
1918
def mock_get_terminal_size():
2019
return os.terminal_size((80, 24))
2120

tests/test_json.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import json
88

99

10-
1110
def create_test_json(tmp_path: Path, filename: str, data: Any) -> Path:
1211
file_path = tmp_path / filename
1312
with open(file_path, "w") as file:

0 commit comments

Comments
 (0)