Skip to content

Commit 2b09928

Browse files
authored
Fix pylint issues on main (#167)
At present `main` does not pass the formatting and linting checks; this PR fixes this.
1 parent af251fc commit 2b09928

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/databricks/labs/blueprint/paths.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def __new__(cls, *args, **kwargs):
138138
# Force all initialisation to go via __init__() irrespective of the (Python-specific) base version.
139139
return object.__new__(cls)
140140

141-
# pylint: disable=super-init-not-called
142141
def __init__(self, ws: WorkspaceClient, *args: str | bytes | os.PathLike) -> None:
143142
# We deliberately do _not_ call the super initializer because we're taking over complete responsibility for the
144143
# implementation of the public API.
@@ -386,7 +385,6 @@ def with_suffix(self: P, suffix: str) -> P:
386385
raise ValueError(msg)
387386
return self.with_name(stem + suffix)
388387

389-
# pylint: disable=arguments-differ
390388
def relative_to(self: P, *other: str | bytes | os.PathLike, walk_up: bool = False) -> P:
391389
normalized = self.with_segments(*other)
392390
if self.anchor != normalized.anchor:
@@ -528,13 +526,14 @@ def _normalize(self: P) -> P:
528526
return self
529527
segments: list[str] = []
530528
for part in self._path_parts:
531-
if part == "..":
532-
if segments:
533-
segments.pop()
534-
elif part is None or part == '.':
535-
continue
536-
else:
537-
segments.append(part)
529+
match part:
530+
case "..":
531+
if segments:
532+
segments.pop()
533+
case None | ".":
534+
pass
535+
case _:
536+
segments.append(part)
538537
# pylint: disable=protected-access
539538
return self.with_segments(self.anchor, *segments)._normalize()
540539

0 commit comments

Comments
 (0)