Skip to content

Commit

Permalink
Fix list options in configuration files. (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacetown committed Apr 18, 2022
1 parent bdde94f commit ba4de0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Expand Up @@ -26,7 +26,8 @@ Bug fixes and small improvements:
- Use `` sign instead of `>=` in HTML legend. (:issue:`603`)
- Using :option:`--add-tracefile` will now correctly merge branch coverage. (:issue:`600`)
- Fix package-level function coverage statistics in Cobertura XML reports. (:issue:`605`)
- Respect excluded/noncode lines for aggregated branch coverage. (:issue:`611`)
- Respect excluded/noncode lines for aggregated branchcoverage. (:issue:`611`)
- Fix list options in configuration file (search-path). (:issue:`612`)

Documentation:

Expand Down
11 changes: 5 additions & 6 deletions gcovr/configuration.py
Expand Up @@ -523,19 +523,18 @@ def _assign_value_to_dict(
option: GcovrConfigOption,
is_single_value: bool,
) -> None:

if option.action in ("store", "store_const"):
namespace[option.name] = value
return

if option.action == "append":
if option.action == "append" or option.nargs == "*":
append_target = namespace.setdefault(option.name, [])
if is_single_value:
append_target.append(value)
else:
append_target.extend(value)
return

if option.action in ("store", "store_const"):
namespace[option.name] = value
return

assert False, f"unexpected action for {option.name}: {option.action!r}"


Expand Down
1 change: 1 addition & 0 deletions gcovr/tests/config-output/config/gcovr.config
@@ -1,3 +1,4 @@
html-css=style.css
output=../coverage.html
filter=.*
search-path=../

0 comments on commit ba4de0e

Please sign in to comment.