Group bin's root modules into packages named by purpose, and make rank_todo.py a launcher of release_plan/ranking.py
This commit is contained in:
@@ -4,15 +4,13 @@ import pathlib
|
||||
from rule_hook.rules import Breach
|
||||
from failure import Failure
|
||||
from rule_hook.git import guarded_git
|
||||
import rank_todo
|
||||
|
||||
|
||||
from release_plan import ranking
|
||||
def todo_breaches(directory: str) -> list[Breach]:
|
||||
top = guarded_git(directory, "rev-parse", "--show-toplevel")
|
||||
if isinstance(top, Failure) or not (pathlib.Path(top) / "todo.md").is_file():
|
||||
return []
|
||||
todo = pathlib.Path(top) / "todo.md"
|
||||
return [Breach("todo-rank-check", line, top) for line in rank_todo.check_failures(todo)] if changed(top, todo) else []
|
||||
return [Breach("todo-rank-check", line, top) for line in ranking.check_failures(todo)] if changed(top, todo) else []
|
||||
|
||||
|
||||
def changed(top: str, todo: pathlib.Path) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user