Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect pathmapper name conflicts. #805

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
10 changes: 10 additions & 0 deletions cwltool/pathmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ def setup(self, referenced_files: List[CWLObjectType], basedir: str) -> None:
staged=True,
)

targets: Dict[str, str] = {}
for k, v in self._pathmap.items():
if v.target in targets:
raise ValidationException(
"Name conflict: both %s and %s have been assigned to target %s"
% (k, targets[v.target], v.target)
)
if v.type != "Directory":
targets[v.target] = k

def mapper(self, src: str) -> MapperEnt:
if "#" in src:
i = src.index("#")
Expand Down