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

moonbitlang / core / 4196

05 May 2026 11:22PM UTC coverage: 94.617% (-0.001%) from 94.618%
4196

push

github

bobzhang
refactor(argparse): collapse has_subcommands_for_help with Array::any

```diff
 fn has_subcommands_for_help(cmd : Command) -> Bool {
-  if help_subcommand_enabled(cmd) {
-    return true
-  }
-  for sub in cmd.subcommands {
-    if !sub.hidden {
-      return true
-    }
-  }
-  false
+  help_subcommand_enabled(cmd) || cmd.subcommands.any(sub => !sub.hidden)
 }
```

Same idiom as the earlier `Array::any` collapses (#3530). Boolean
short-circuit on the early-exit branch preserves the original behavior.

Semantics-preserving: `moon test -p argparse` (225/225) passes and
`moon info` produces no `.mbti` change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

14835 of 15679 relevant lines covered (94.62%)

218861.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.13
/argparse/help_render.mbt


Source Not Available

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