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

[client] Fix duplication warning when collecting blame info #3446

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions web/client/codechecker_client/blame_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from concurrent.futures import ProcessPoolExecutor
from git import Repo
from git.exc import InvalidGitRepositoryError
from typing import Dict, List, Optional
from typing import Dict, Iterable, Optional

from codechecker_common.logger import get_logger

Expand Down Expand Up @@ -74,7 +74,7 @@ def __get_blame_info(file_path: str):


def __collect_blame_info_for_files(
file_paths: List[str],
file_paths: Iterable[str],
zip_iter=map
) -> FileBlameInfo:
""" Collect blame information for the given file paths. """
Expand All @@ -88,7 +88,7 @@ def __collect_blame_info_for_files(

def assemble_blame_info(
zip_file: zipfile.ZipFile,
file_paths: List[str]
file_paths: Iterable[str]
) -> bool:
"""
Collect and write blame information for the given files to the zip file.
Expand Down
4 changes: 2 additions & 2 deletions web/client/codechecker_client/cmd/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,13 +680,13 @@ def assemble_zip(inputs, zip_file, client):

zipf.write(ftc, zip_target)

collected_file_paths = []
collected_file_paths = set()
for f, h in file_to_hash.items():
if h in necessary_hashes or h in file_hash_with_review_status:
LOG.debug("File contents for '%s' needed by the server", f)

file_path = os.path.join('root', f.lstrip('/'))
collected_file_paths.append(f)
collected_file_paths.add(f)

try:
zipf.getinfo(file_path)
Expand Down