Skip to content

Commit

Permalink
Work around yapf/sphinx bug for starred expression when calling __get…
Browse files Browse the repository at this point in the history
…item__()
  • Loading branch information
boehmseb committed Aug 29, 2024
1 parent aaaa93a commit 3202244
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions varats-core/varats/utils/git_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,13 @@ def contains_source_code(
if not churn_config:
churn_config = ChurnConfig.create_c_style_languages_config()

return_code = repo["show", "--exit-code", "-m", "--quiet", commit.hash,
"--", *churn_config.get_extensions_repr('*.')] & RETCODE
git_show_args = ["show", "--exit-code", "-m", "--quiet", commit.hash, "--"]
git_show_args += churn_config.get_extensions_repr('*.')
# There should be a '*' in front of 'git_show_args' to unpack the list.
# However, yapf and sphinx are unable to parse this.
# Fortunately, plumbum seems to unpack this correctly before running.
# Still: fix when possible.
return_code = repo[git_show_args] & RETCODE

if return_code == 0:
return False
Expand Down

0 comments on commit 3202244

Please sign in to comment.