Skip to content

Commit 27f4eac

Browse files
authored
Merge pull request #3 from easy-as-python/fix/lint-and-format
Fix linting and formatting
2 parents 3223ae4 + 3b0c9cf commit 27f4eac

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ deps =
101101
furo
102102
sphinx
103103
commands =
104+
python --version
104105
sphinx-apidoc \
105106
--force \
106107
--implicit-namespaces \

src/repoman/cli.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@
44
import configparser
55
import sys
66
from pathlib import Path
7-
from typing import NoReturn
7+
from typing import NoReturn, Union
88

99

1010
FAIL = "\033[91m"
1111
ENDC = "\033[0m"
1212
REPO_TYPES_CFG = "repo-types.cfg"
1313

1414

15-
def check_if_allowed(path: Path) -> bool | NoReturn:
15+
def check_if_allowed(path: Path) -> Union[bool, NoReturn]:
1616
if REPO_TYPES_CFG not in (str(item) for item in path.iterdir()):
17-
print(
18-
f"{FAIL}The current directory is not configured for repository management{ENDC}"
19-
)
17+
print(f"{FAIL}The current directory is not configured for repository management{ENDC}")
2018
sys.exit(1)
2119

2220
return True
@@ -79,7 +77,7 @@ def parse_repo_types() -> dict[str, set[str]]:
7977
return repo_types
8078

8179

82-
def check_missing_repos(path: Path, repo_types: dict[str, set[str]]) -> None | NoReturn:
80+
def check_missing_repos(path: Path, repo_types: dict[str, set[str]]) -> Union[None, NoReturn]:
8381
missing = set()
8482
directories = {str(directory) for directory in path.iterdir()}
8583

@@ -90,7 +88,7 @@ def check_missing_repos(path: Path, repo_types: dict[str, set[str]]) -> None | N
9088
if missing:
9189
print(f"{FAIL}The following repositories are configured but do not exist:")
9290
for repo in missing:
93-
print("\t{repo}")
91+
print(f"\t{repo}")
9492
sys.exit(1)
9593

9694
return None
@@ -128,7 +126,11 @@ def main():
128126

129127
if args.unconfigured:
130128
for directory in sorted(path.iterdir()):
131-
if directory.is_dir() and str(directory) not in repo_types["all"] and str(directory) not in repo_types["ignore"]:
129+
if (
130+
directory.is_dir()
131+
and str(directory) not in repo_types["all"]
132+
and str(directory) not in repo_types["ignore"]
133+
):
132134
print(directory)
133135

134136
if args.list:
@@ -143,4 +145,3 @@ def main():
143145
if repo in seen:
144146
print(repo)
145147
seen.add(repo)
146-

test/test_repoman.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
def test_package_is_importable():
22
import repoman
3+
4+
print(repoman)

0 commit comments

Comments
 (0)