From 66657c17d33ccdffa8ca95c8efa9bd4d64bddf5e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 8 Nov 2022 05:30:29 -0500 Subject: fix: path-mapped results shouldn't start with ./ Unless the actual result in the config starts with ./ --- coverage/files.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'coverage/files.py') diff --git a/coverage/files.py b/coverage/files.py index 82f4df31..bfd808ff 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -435,6 +435,9 @@ class PathAliases: new = new.replace(sep(path), sep(result)) if not self.relative: new = canonical_filename(new) + dot_start = result.startswith(("./", ".\\")) and len(result) > 2 + if new.startswith(("./", ".\\")) and not dot_start: + new = new[2:] self.debugfn( f"Matched path {path!r} to rule {original_pattern!r} -> {result!r}, " + f"producing {new!r}" -- cgit v1.2.1