jw.pkg.App: Code beautification

Major - but not yet sufficient - code beautification starting from jw.pkg.App.

- Make more methods private - Rename methods to be more self-explanatory - Same for method arguments, notably clean up some inconsistent uses of "module" vs "project" - Add more type hints

Fix API breakage in the command modules.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-01-29 10:58:51 +01:00
commit 6ca4af77d7
12 changed files with 204 additions and 209 deletions

View file

@ -17,19 +17,8 @@ class CmdCheck(Cmd): # export
parser.add_argument('-f', '--flavour', nargs='?', default = 'build')
async def _run(self, args: Namespace) -> None:
graph = {}
path = []
self.app.read_dep_graph(args.module, args.flavour, graph)
unvisited = list(graph.keys())
temp = set()
while len(unvisited) != 0:
m = unvisited[0]
log(DEBUG, 'Checking circular dependency of', m)
last = self.app.check_circular_deps(m, args.flavour, self.app.flip_graph(graph), unvisited, temp, path)
if last is not None:
log(DEBUG, 'Found circular dependency below', m, ', last is', last)
print('Found circular dependency in flavour', args.flavour, ':', ' -> '.join(path))
exit(1)
print('No circular dependency found for flavour', args.flavour, ' in modules:',
' '.join(args.module))
exit(0)
path = self.app.find_circular_deps(args.module, args.flavour)
if path:
print(f'Found circular dependency in flavour {args.flavour}:', ' -> '.join(path))
exit(1)
print(f'No circular dependency found for flavour {args.flavour} in modules:', ' '.join(args.module))