christophebedard / dco-check

Simple DCO check script to be used in any CI
Apache License 2.0
12 stars 6 forks source link

Reset locale when invoking external commands #96

Closed zyga closed 3 years ago

zyga commented 3 years ago

When external commands, like git, are invoked, they can return localized text. This breaks the logic carefully parsing the output, such as when get_default_branch_from_remote is invoked on a system with non-English locale and properly translated git.

Prune LANG and any variables starting with LC_ from the environment, reverting back to the usual C locale.

Signed-off-by: Zygmunt Krynicki me@zygoon.pl

codecov[bot] commented 3 years ago

Codecov Report

Merging #96 (ab07114) into master (cc6cb61) will decrease coverage by 4.19%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
- Coverage   73.12%   68.93%   -4.20%     
==========================================
  Files           2        2              
  Lines         480      486       +6     
  Branches       77       80       +3     
==========================================
- Hits          351      335      -16     
- Misses         98      127      +29     
+ Partials       31       24       -7     
Impacted Files Coverage Δ
dco_check/dco_check.py 68.80% <100.00%> (-4.22%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update cc6cb61...ab07114. Read the comment docs.