• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

python-useful-helpers / exec-helpers / 43426686107
90%

Build:
DEFAULT BRANCH: master
Ran 13 Nov 2026 12:38PM UTC
Jobs 8
Files 19
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Nov 2026 12:36PM UTC coverage: 89.583% (+0.9%) from 88.727%
43426686107

push

github

web-flow
Add MaskedArg to hide a secret argument of a list command (#181)

* Add MaskedArg to hide a secret argument of a list command

log_mask_re matches the joined, shell-quoted command, so the rule has to
model shlex quoting: --pass=(\S+) leaks the rest of a value with spaces,
--pass=(.+) also hides the next arguments and still leaks after a
newline.

MaskedArg is masked per argument, before the command is joined:

    helper.execute(["tool", MaskedArg.option("pass", password), "-v"])
    # executed: tool '--pass=two words' -v
    # logged:   tool '--pass=<*masked*>' -v

- MaskedArg(arg, arg_for_log) is a frozen dataclass, its repr hides arg.
- Constructors: secret(arg), option(name, value) and regex(arg, rule).
  option() takes the bare name and follows the CLI conventions: a long
  name gives GNU's --name=value, a single character POSIX's -nvalue.
  An option and its value as separate arguments need no helper:
  ["--pass", MaskedArg.secret(value)].
- CommandT accepts MaskedArg items. A list command is joined twice: with
  arg for execution and with arg_for_log for the log, ExecResult.cmd,
  the exceptions and the context repr. log_mask_re still applies on top.
- open_execute_context, _exec_command and _log_command_execute take a
  keyword-only command_for_log. The context prepares it with chroot and
  sudo like the command, so their extra quoting does not matter.
- Covers Subprocess (with and without shell), async Subprocess,
  SSHClient and execute_together.

* Add MaskedArg.key_value for keys without dashes

option() always adds - or --, so an argument like dd's if=... could
only be built with the raw constructor.

- key_value(key, value, sep="=") writes the key exactly as given:
  key_value("if", path) is if=<path>, shown as if=<*masked*>.
- An empty key is rejected.
- option() now builds its argument through key_value, adding the
  dashes and choosing the separator itself.

369 of 462 branches covered (79.87%)

Branch coverage included in aggregate %.

52 of 52 new or added lines in 6 files covered. (100.0%)

1824 of 1986 relevant lines covered (91.84%)

7.02 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.14-ubuntu-latest - 43426686107.1 13 Nov 2026 12:38PM UTC 19
89.58
GitHub Action Run
2 run-3.11-windows-latest - 43426686107.2 13 Nov 2026 12:38PM UTC 19
81.45
GitHub Action Run
3 run-3.11-ubuntu-latest - 43426686107.3 13 Nov 2026 12:38PM UTC 19
89.58
GitHub Action Run
4 run-3.12-windows-latest - 43426686107.4 13 Nov 2026 12:38PM UTC 19
81.45
GitHub Action Run
5 run-3.13-windows-latest - 43426686107.5 13 Nov 2026 12:39PM UTC 19
81.45
GitHub Action Run
6 run-3.12-ubuntu-latest - 43426686107.6 13 Nov 2026 12:38PM UTC 19
89.58
GitHub Action Run
7 run-3.13-ubuntu-latest - 43426686107.7 13 Nov 2026 12:38PM UTC 19
89.58
GitHub Action Run
8 run-3.14-windows-latest - 43426686107.8 13 Nov 2026 12:39PM UTC 19
81.45
GitHub Action Run
Source Files on build 43426686107
  • Tree
  • List 19
  • Changed 8
  • Source Changed 8
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #43426686107
  • 89b33a11 on github
  • Prev Build on master (#42875067036)
  • Next Build on master (#44777851013)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc