Skip to content

Pr/collections#306

Merged
moshloop merged 2 commits intomasterfrom
pr/collections
Mar 31, 2026
Merged

Pr/collections#306
moshloop merged 2 commits intomasterfrom
pr/collections

Conversation

@moshloop
Copy link
Copy Markdown
Member

@moshloop moshloop commented Mar 31, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Windows builds now correctly produce binaries with the .exe extension
    • Pattern matching operations now perform case-insensitive comparisons
    • Duration formatting improved for accurate millisecond and sub-minute display
  • Tests

    • Added test coverage for case-insensitive pattern matching scenarios
    • Added test coverage for millisecond duration formatting

The Windows hx-binaries job was failing because `go build -o .bin/hx`
doesn't auto-append .exe when -o is explicit, but the workflow rename
step expected hx.exe. This caused hx-upload-release to be skipped,
leaving releases with no binary assets.
@moshloop moshloop enabled auto-merge (rebase) March 31, 2026 14:14
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9cbffdcd-104b-4dd8-9b39-406ef483f7f2

📥 Commits

Reviewing files that changed from the base of the PR and between 8ee11e2 and 0c9e84f.

📒 Files selected for processing (5)
  • cmd/hx/Makefile
  • collections/slice.go
  • collections/slice_test.go
  • duration/duration.go
  • duration/manual_test.go

Walkthrough

Platform-specific binary naming added to Makefile for Windows builds. Pattern matching logic modified to perform case-insensitive string comparisons. Duration string formatting refined for accurate sub-minute truncation. Test coverage expanded for case-insensitive matching and millisecond formatting scenarios.

Changes

Cohort / File(s) Summary
Build Configuration
cmd/hx/Makefile
Added EXT variable that computes to .exe on Windows and remains empty otherwise, updating binary output path from .bin/hx to .bin/hx$(EXT) for platform-specific naming.
Pattern Matching
collections/slice.go, collections/slice_test.go
Modified matchPattern function to use case-insensitive comparison by lowercasing both item and pattern before matching. Wildcard and substring checks updated to use lowercased values. Added test cases covering case-insensitive exact/prefix/suffix matching and negation scenarios.
Duration Formatting
duration/duration.go, duration/manual_test.go
Refined sub-minute truncation logic in Duration.String() to remove the d.Seconds() > 2 branch and adjust millisecond truncation threshold. Replaced broad string cleanup with targeted logic that preserves "0ms" while removing isolated "0m" and trailing "0s". Added TestMillisecondFormatting test function with table-driven test cases for millisecond and fractional-second formatting.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr/collections
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch pr/collections

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@moshloop moshloop merged commit 6ba89ec into master Mar 31, 2026
3 of 5 checks passed
@moshloop moshloop deleted the pr/collections branch March 31, 2026 14:16
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.50.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant