Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions components/polylith/diff/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
from polylith import repo, workspace


def _parse_brick_name(folder: str, changed_file: Path) -> str:
def _parse_folder_parts(folder: str, changed_file: Path) -> str:
file_path = Path(changed_file.as_posix().replace(folder, ""))

return next(p for p in file_path.parts if p != file_path.root)


def _get_changed(folder: str, changed_files: List[Path]) -> set:
return {_parse_brick_name(folder, f) for f in changed_files if folder in f.as_posix()}
return {
_parse_folder_parts(folder, f) for f in changed_files if folder in f.as_posix()
}


def _get_changed_bricks(
Expand Down
2 changes: 1 addition & 1 deletion components/polylith/diff/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _changed_projects(
projects_data: List[dict], brick_type: str, bricks: List[str]
) -> set:
res = {
p["name"]: set(p.get(brick_type, [])).intersection(bricks)
p["path"].name: set(p.get(brick_type, [])).intersection(bricks)
for p in projects_data
}

Expand Down