diff --git a/codecov_cli/helpers/folder_searcher.py b/codecov_cli/helpers/folder_searcher.py index 8b7f35dfa..ece969a4e 100644 --- a/codecov_cli/helpers/folder_searcher.py +++ b/codecov_cli/helpers/folder_searcher.py @@ -15,7 +15,12 @@ def _is_included( multipart_include_regex: Optional[Pattern], path: pathlib.Path, ): - return filename_include_regex.match(path.name) and ( + try: + path_name = path.name + except TypeError: + logger.warning(f"Unable to determine name for path: {path}") + return False + return filename_include_regex.match(path_name) and ( multipart_include_regex is None or multipart_include_regex.match(path.resolve().as_posix()) ) diff --git a/codecov_cli/plugins/gcov.py b/codecov_cli/plugins/gcov.py index 7cc3ce7f9..96ffbe9af 100644 --- a/codecov_cli/plugins/gcov.py +++ b/codecov_cli/plugins/gcov.py @@ -25,7 +25,10 @@ def __init__( ): self.executable = executable or "gcov" self.extra_arguments = extra_arguments or [] - self.folders_to_ignore = folders_to_ignore or [] + default_folders_to_ignore = ["node_modules", ".git", "vendor"] + self.folders_to_ignore = list( + set(default_folders_to_ignore + (folders_to_ignore or [])) + ) self.patterns_to_ignore = patterns_to_ignore or [] self.patterns_to_include = patterns_to_include or [] self.project_root = project_root or pathlib.Path(os.getcwd())