Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,7 @@ gau
gawk
gcalcli
gcem
gci
gcovr
gcsfuse
gdal
Expand Down
42 changes: 42 additions & 0 deletions Formula/g/gci.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
class Gci < Formula
desc "Control Golang package import order and make it always deterministic"
homepage "https://github.com/daixiang0/gci"
url "https://github.com/daixiang0/gci/archive/refs/tags/v0.13.5.tar.gz"
sha256 "1429a8486ea4b2b58ce7c507823c36239d88fc277c1229323858d1c9554767ce"
license "BSD-3-Clause"
head "https://github.com/daixiang0/gci.git", branch: "master"

depends_on "go" => :build

def install
system "go", "build", *std_go_args(ldflags: "-s -w")
end

test do
(testpath/"main.go").write <<~GO
package main
import (
"golang.org/x/tools"

"fmt"

"github.com/daixiang0/gci"
)
GO
system bin/"gci", "write", testpath/"main.go"

assert_equal <<~GO, (testpath/"main.go").read
package main

import (
\t"fmt"

\t"github.com/daixiang0/gci"
\t"golang.org/x/tools"
)
GO

# currently the version is off, see upstream pr, https://github.com/daixiang0/gci/pull/218
# assert_match version.to_s, shell_output("#{bin}/gci --version")
end
end
Loading