Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacetown committed Dec 12, 2023
1 parent 3b2c19a commit ba4dc42
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions gcovr/formats/gcov/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def find_existing_gcov_files(
search_file(
re.compile(r".*\.gcov(?:\.json\.gz)?$").match,
search_path,
exclude_dirs=exclude_dirs
exclude_dirs=exclude_dirs,
)
)
LOGGER.debug(f"Found {len(gcov_files)} files (and will process all of them)")
Expand Down Expand Up @@ -638,8 +638,9 @@ def identify_and_cache_capabilities(self) -> None:
LOGGER.debug("GCOV capabilities: JSON format available.")
GcovProgram.__default_options.append("--json-format")

Check warning on line 639 in gcovr/formats/gcov/read.py

View check run for this annotation

Codecov / codecov/patch

gcovr/formats/gcov/read.py#L638-L639

Added lines #L638 - L639 were not covered by tests
else:
LOGGER.debug("GCOV capabilities: Unsupported JSON format detected.")

LOGGER.debug(
"GCOV capabilities: Unsupported JSON format detected."
)

if self.__check_gcov_help_content("--demangled-names"):
LOGGER.debug("GCOV capabilities: Demangling of names available.")
Expand Down Expand Up @@ -691,7 +692,9 @@ def __get_version_output(self) -> str:

if gcov_process.returncode:
# gcov tossed errors: throw exception
raise RuntimeError("Error in gcov command line, couldn't get version information.")
raise RuntimeError(

Check warning on line 695 in gcovr/formats/gcov/read.py

View check run for this annotation

Codecov / codecov/patch

gcovr/formats/gcov/read.py#L695

Added line #L695 was not covered by tests
"Error in gcov command line, couldn't get version information."
)
# gcov execution was successful, help argument is not supported.
GcovProgram.__version_output = out

Expand Down Expand Up @@ -856,11 +859,15 @@ def run_gcov_and_process_files(
# Process *.gcov files
for gcov_filename in active_gcov_files:
if gcov_filename.endswith(".gcov"):
process_gcov_data(gcov_filename, filename, covdata, options, chdir)
process_gcov_data(
gcov_filename, filename, covdata, options, chdir
)
elif gcov_filename.endswith(".json.gz"):
process_gcov_json_data(gcov_filename, covdata, options)

Check warning on line 866 in gcovr/formats/gcov/read.py

View check run for this annotation

Codecov / codecov/patch

gcovr/formats/gcov/read.py#L866

Added line #L866 was not covered by tests
else:
raise RuntimeError(f"Unknown gcov output format {filename}.")
raise RuntimeError(

Check warning on line 868 in gcovr/formats/gcov/read.py

View check run for this annotation

Codecov / codecov/patch

gcovr/formats/gcov/read.py#L868

Added line #L868 was not covered by tests
f"Unknown gcov output format {filename}."
)
done = True

if options.gcov_keep and done:
Expand Down

0 comments on commit ba4dc42

Please sign in to comment.