Skip to content

Commit 337d272

Browse files
committed
linting
1 parent 89efc34 commit 337d272

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ ensure_newline_before_comments = true
147147
max-complexity = 12
148148
max-line-length = 127
149149
select = ["E", "F", "W", "C90"]
150-
extend-ignore = ["E203", "E266", "W503"]
150+
extend-ignore = ["E203", "E266", "E502", "W503"]
151151
per-file-ignores = ["__init__.py:F403,F405"]
152152

153153
[tool.setuptools]

src/xulbux/data.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717

1818
_DEFAULT_SYNTAX_HL: Final[dict[str, tuple[str, str]]] = {
19-
"str": (f"[br:blue]", "[_c]"),
20-
"number": (f"[br:magenta]", "[_c]"),
21-
"literal": (f"[magenta]", "[_c]"),
22-
"type": (f"[i|green]", "[_i|_c]"),
23-
"punctuation": (f"[br:black]", "[_c]"),
19+
"str": ("[br:blue]", "[_c]"),
20+
"number": ("[br:magenta]", "[_c]"),
21+
"literal": ("[magenta]", "[_c]"),
22+
"type": ("[i|green]", "[_i|_c]"),
23+
"punctuation": ("[br:black]", "[_c]"),
2424
}
2525
"""Default syntax highlighting styles for data structure rendering."""
2626

@@ -539,7 +539,8 @@ def _get_path_id(path: str, path_sep: str, data_obj: Any, ignore_not_found: bool
539539
path_ids.append(str(idx))
540540
max_id_length = max(max_id_length, len(str(idx)))
541541

542-
if not path_ids: return None
542+
if not path_ids:
543+
return None
543544
return f"{max_id_length}>{''.join(id.zfill(max_id_length) for id in path_ids)}"
544545

545546
@classmethod
@@ -716,7 +717,8 @@ def should_expand(self, seq: IndexIterable) -> bool:
716717
return False
717718

718719
complex_types: tuple[type, ...] = (list, tuple, dict, set, frozenset)
719-
if self.as_json: complex_types += (bytes, bytearray)
720+
if self.as_json:
721+
complex_types += (bytes, bytearray)
720722

721723
complex_items = sum(1 for item in seq if isinstance(item, complex_types))
722724

src/xulbux/path.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ def extend(
102102
for search_dir in search_dirs:
103103
if _os.path.exists(full_path := _os.path.join(search_dir, rel_path)):
104104
return full_path
105-
if (match :=
106-
cls._find_path(search_dir, rel_path.split(_os.sep), use_closest_match) if use_closest_match else None):
105+
if (match := (
106+
cls._find_path(search_dir, rel_path.split(_os.sep), use_closest_match) \
107+
if use_closest_match else None
108+
)):
107109
return match
108110

109111
if raise_error:

0 commit comments

Comments
 (0)