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

fix: log info if a file shows up as a directory #430

Merged
merged 3 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion codecov_cli/helpers/folder_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def search_files(
this_is_excluded = functools.partial(
_is_excluded, filename_exclude_regex, multipart_exclude_regex
)
for (dirpath, dirnames, filenames) in os.walk(folder_to_search):
for dirpath, dirnames, filenames in os.walk(folder_to_search):
dirs_to_remove = set(d for d in dirnames if d in folders_to_ignore)

if multipart_exclude_regex is not None:
Expand Down
8 changes: 5 additions & 3 deletions codecov_cli/helpers/git_services/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ def get_pull_request(self, slug, pr_number) -> PullDict:
"ref": res["head"]["ref"],
# Through empiric test data it seems that the "repo" key in "head" is set to None
# If the PR is from the same repo (e.g. not from a fork)
"slug": res["head"]["repo"]["full_name"]
if res["head"]["repo"]
else res["base"]["repo"]["full_name"],
"slug": (
res["head"]["repo"]["full_name"]
if res["head"]["repo"]
else res["base"]["repo"]["full_name"]
),
},
"base": {
"sha": res["base"]["sha"],
Expand Down
8 changes: 5 additions & 3 deletions codecov_cli/helpers/versioning_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ def list_relevant_files(
)

return [
filename[1:-1]
if filename.startswith('"') and filename.endswith('"')
else filename
(
filename[1:-1]
if filename.startswith('"') and filename.endswith('"')
else filename
)
for filename in res.stdout.decode("unicode_escape").strip().split("\n")
]

Expand Down
4 changes: 2 additions & 2 deletions codecov_cli/services/staticanalysis/analyzers/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ def _get_parent_chain(self, node):

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

def get_definition_lines(self, root_node, definitions_query):
definition_lines = set()
for (a, _) in definitions_query.captures(root_node):
for a, _ in definitions_query.captures(root_node):
definition_lines.add(
(a.start_point[0] + 1, a.end_point[0] - a.start_point[0])
)
Expand Down
2 changes: 2 additions & 0 deletions codecov_cli/services/upload/upload_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
reason=err.reason,
),
)
except IsADirectoryError as err:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the relevant section

logger.info(f"Skipping {filename}, found a directory not a file")

Check warning on line 143 in codecov_cli/services/upload/upload_collector.py

View check run for this annotation

Codecov / codecov/patch

codecov_cli/services/upload/upload_collector.py#L142-L143

Added lines #L142 - L143 were not covered by tests

return UploadCollectionResultFileFixer(
path, fixed_lines_without_reason, fixed_lines_with_reason, eof
Expand Down