Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit e4b6e1c

Browse files
fix: log info if a file shows up as a directory (#430)
* fix: log info if a file shows up as a directory * fix: black * fix: lint
1 parent 88b7c71 commit e4b6e1c

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

codecov_cli/helpers/folder_searcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def search_files(
5858
this_is_excluded = functools.partial(
5959
_is_excluded, filename_exclude_regex, multipart_exclude_regex
6060
)
61-
for (dirpath, dirnames, filenames) in os.walk(folder_to_search):
61+
for dirpath, dirnames, filenames in os.walk(folder_to_search):
6262
dirs_to_remove = set(d for d in dirnames if d in folders_to_ignore)
6363

6464
if multipart_exclude_regex is not None:

codecov_cli/helpers/git_services/github.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ def get_pull_request(self, slug, pr_number) -> PullDict:
2424
"ref": res["head"]["ref"],
2525
# Through empiric test data it seems that the "repo" key in "head" is set to None
2626
# If the PR is from the same repo (e.g. not from a fork)
27-
"slug": res["head"]["repo"]["full_name"]
28-
if res["head"]["repo"]
29-
else res["base"]["repo"]["full_name"],
27+
"slug": (
28+
res["head"]["repo"]["full_name"]
29+
if res["head"]["repo"]
30+
else res["base"]["repo"]["full_name"]
31+
),
3032
},
3133
"base": {
3234
"sha": res["base"]["sha"],

codecov_cli/helpers/versioning_systems.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ def list_relevant_files(
135135
)
136136

137137
return [
138-
filename[1:-1]
139-
if filename.startswith('"') and filename.endswith('"')
140-
else filename
138+
(
139+
filename[1:-1]
140+
if filename.startswith('"') and filename.endswith('"')
141+
else filename
142+
)
141143
for filename in res.stdout.decode("unicode_escape").strip().split("\n")
142144
]
143145

codecov_cli/services/staticanalysis/analyzers/general.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ def _get_parent_chain(self, node):
8585

8686
def get_import_lines(self, root_node, imports_query):
8787
import_lines = set()
88-
for (a, _) in imports_query.captures(root_node):
88+
for a, _ in imports_query.captures(root_node):
8989
import_lines.add((a.start_point[0] + 1, a.end_point[0] - a.start_point[0]))
9090
return import_lines
9191

9292
def get_definition_lines(self, root_node, definitions_query):
9393
definition_lines = set()
94-
for (a, _) in definitions_query.captures(root_node):
94+
for a, _ in definitions_query.captures(root_node):
9595
definition_lines.add(
9696
(a.start_point[0] + 1, a.end_point[0] - a.start_point[0])
9797
)

codecov_cli/services/upload/upload_collector.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def _get_file_fixes(
139139
reason=err.reason,
140140
),
141141
)
142+
except IsADirectoryError as err:
143+
logger.info(f"Skipping {filename}, found a directory not a file")
142144

143145
return UploadCollectionResultFileFixer(
144146
path, fixed_lines_without_reason, fixed_lines_with_reason, eof

0 commit comments

Comments
 (0)