Skip to content

Commit

Permalink
nox -s lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Apr 1, 2024
1 parent f1ed2ef commit 851e58d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
18 changes: 4 additions & 14 deletions dev/generate_flavours.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,27 +118,17 @@ def __init_subclass__(cls: Any, **kwargs):

def _fix_abstract_file_system(x: str) -> str:
x = re.sub(
"protocol = 'abstract'",
"protocol: str | tuple[str, ...] = 'abstract'",
x
)
x = re.sub(
"root_marker = ''",
"root_marker: Literal['', '/'] = ''",
x
)
x = re.sub(
"sep = '/'",
"sep: Literal['/'] = '/'",
x
"protocol = 'abstract'", "protocol: str | tuple[str, ...] = 'abstract'", x
)
x = re.sub("root_marker = ''", "root_marker: Literal['', '/'] = ''", x)
x = re.sub("sep = '/'", "sep: Literal['/'] = '/'", x)
return x


def _fix_azure_blob_file_system(x: str) -> str:
x = re.sub(
r"if isinstance\(path, list\):",
'if isinstance(path, list): # type: ignore[unreachable]',
"if isinstance(path, list): # type: ignore[unreachable]",
x,
)
x = re.sub(
Expand Down
9 changes: 6 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ def typesafety(session):
session.install("-e", ".[tests]")
session.run(
"python",
"-m", "pytest",
"-m",
"pytest",
"-v",
"-p", "pytest-mypy-plugins",
"--mypy-pyproject-toml-file", "pyproject.toml",
"-p",
"pytest-mypy-plugins",
"--mypy-pyproject-toml-file",
"pyproject.toml",
"typesafety",
)

Expand Down
4 changes: 1 addition & 3 deletions upath/_flavour.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ def join(self, path: PathOrStr, *paths: PathOrStr) -> str:
pN = list(map(self.stringify_path, paths))
drv = ""
if self.supports_empty_parts:
return drv + self.sep.join(
[str_remove_suffix(p0, self.sep), *pN]
)
return drv + self.sep.join([str_remove_suffix(p0, self.sep), *pN])
else:
return drv + posixpath.join(p0, *pN)

Expand Down

0 comments on commit 851e58d

Please sign in to comment.