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

moonbitlang / core / 4250
94%

Build:
DEFAULT BRANCH: main
Ran 08 May 2026 01:11PM UTC
Jobs 1
Files 364
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

08 May 2026 01:09PM UTC coverage: 94.637%. Remained the same
4250

push

github

bobzhang
refactor(argparse): collapse usage_tail to filter-and-join

`usage_tail` had a `let mut tail = ""` plus four conditional `tail =
"\{tail} \{...}"` accumulations. Replace with a single array literal,
filter-non-empty, and join:

```diff
 fn usage_tail(cmd : Command) -> String {
-  let mut tail = ""
-  let required_options = required_option_usage(cmd)
-  if required_options != "" {
-    tail = "\{tail} \{required_options}"
-  }
-  if has_options(cmd) {
-    tail = "\{tail} [options]"
-  }
-  let pos = positional_usage(cmd)
-  if pos != "" {
-    tail = "\{tail} \{pos}"
-  }
-  let sub = subcommand_usage(cmd)
-  if sub != "" {
-    tail = "\{tail} \{sub}"
-  }
-  tail
+  let parts = [
+    required_option_usage(cmd),
+    if has_options(cmd) { "[options]" } else { "" },
+    positional_usage(cmd),
+    subcommand_usage(cmd),
+  ].filter(p => p != "")
+  if parts.is_empty() {
+    ""
+  } else {
+    " " + parts.join(" ")
+  }
 }
```

Eliminates the `let mut` accumulator. Each helper still called once.

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>

11 of 11 new or added lines in 1 file covered. (100.0%)

14894 of 15738 relevant lines covered (94.64%)

218049.07 hits per line

Jobs
ID Job ID Ran Files Coverage
1 4250.1 08 May 2026 01:11PM UTC 365
94.65
GitHub Action Run
Source Files on build 4250
  • Tree
  • List 364
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • fb556ac6 on github
  • Prev Build on main (#4246)
  • Next Build on main (#4252)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc