puncover icon indicating copy to clipboard operation
puncover copied to clipboard

Fix file path normalization

Open mroja opened this issue 1 year ago • 0 comments

This PR fixes a bug where base_dir is ignored and all paths in the generated report are absolute.

In normalize_files_paths function base_dir is normalized as os.path.abspath(base_dir), but this function returns a string. Then base_dir in path.parents condition fails to detect that we are inside base directory, because it expects pathlib.Path not string.

This PR fixes problem by making base_dir always an instance of pathlib.Path.

mroja avatar Nov 14 '23 17:11 mroja