Skip to content

Commit 7b262f6

Browse files
chore(ci): remediate gofumpt/gci and sync generated files
1 parent 85f80ce commit 7b262f6

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

.custom-gcl.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
version: v2.7.0
1+
# .custom-gcl.yml
2+
golangci-lint:
3+
version: v1.62.2
4+
25
plugins:
3-
- module: "github.com/google/go-github/v82/tools/fmtpercentv"
4-
path: ./tools/fmtpercentv
5-
- module: "github.com/google/go-github/v82/tools/sliceofpointers"
6-
path: ./tools/sliceofpointers
7-
- module: "github.com/google/go-github/v82/tools/structfield"
8-
path: ./tools/structfield
6+
- module: "tools/fmtpercentv"
7+
path: "tools/fmtpercentv"

github/github.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,7 @@ func GetRateLimitCategory(method, path string) RateLimitCategory {
14591459
func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error) {
14601460
return c.RateLimit.Get(ctx)
14611461
}
1462+
14621463
func setCredentialsAsHeaders(req *http.Request, id, secret string) *http.Request {
14631464
// To set extra headers, we must make a copy of the Request so
14641465
// that we don't modify the Request we were given. This is required by the
@@ -1522,6 +1523,7 @@ func (t *UnauthenticatedRateLimitedTransport) RoundTrip(req *http.Request) (*htt
15221523
func (t *UnauthenticatedRateLimitedTransport) Client() *http.Client {
15231524
return &http.Client{Transport: t}
15241525
}
1526+
15251527
func (t *UnauthenticatedRateLimitedTransport) transport() http.RoundTripper {
15261528
if t.Transport != nil {
15271529
return t.Transport
@@ -1556,6 +1558,7 @@ func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error
15561558
func (t *BasicAuthTransport) Client() *http.Client {
15571559
return &http.Client{Transport: t}
15581560
}
1561+
15591562
func (t *BasicAuthTransport) transport() http.RoundTripper {
15601563
if t.Transport != nil {
15611564
return t.Transport
@@ -1585,6 +1588,7 @@ func formatRateReset(d time.Duration) string {
15851588
}
15861589
return fmt.Sprintf("[rate reset in %v]", timeString)
15871590
}
1591+
15881592
func sleepUntilResetWithBuffer(ctx context.Context, reset time.Time) error {
15891593
buffer := time.Second
15901594
timer := time.NewTimer(time.Until(reset) + buffer)

local_ci.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
$ErrorActionPreference = "Stop"
33
# Toolchain Paths
44
$GO_BIN = "C:\Users\Stran\go\pkg\mod\golang.org\toolchain@v0.0.1-go1.24.0.windows-amd64\bin\go.exe"
5-
$GOFMT_BIN = "C:\Users\Stran\go\pkg\mod\golang.org\toolchain@v0.0.1-go1.24.0.windows-amd64\bin\gofmt.exe"
5+
# Use GOFUMPT strictly instead of GOFMT
6+
$GOFUMPT_BIN = "C:\Users\Stran\go\bin\gofumpt.exe"
67
# Local Bin Paths
78
$GCI_BIN = "C:\Users\Stran\go\bin\gci.exe"
89

910
Write-Host "[START] Local CI Simulation (Strict Mode)..." -ForegroundColor Cyan
1011

11-
# 1. Formatting Check (gofmt)
12-
Write-Host "[CHECK] Formatting (gofmt)..." -ForegroundColor Yellow
13-
$fmtOut = & $GOFMT_BIN -l .
12+
# 1. Formatting Check (gofumpt) - STRICTER than gofmt
13+
Write-Host "[CHECK] Formatting (gofumpt)..." -ForegroundColor Yellow
14+
$fmtOut = & $GOFUMPT_BIN -l .
1415
if ($fmtOut) {
15-
Write-Host "[FAIL] Formatting errors found:" -ForegroundColor Red
16+
Write-Host "[FAIL] Formatting errors found (Gofumpt Strictness):" -ForegroundColor Red
1617
$fmtOut
1718
exit 1
1819
}
@@ -21,8 +22,6 @@ Write-Host "[PASS] Formatting OK." -ForegroundColor Green
2122
# 2. Import Sorting Check (gci)
2223
Write-Host "[CHECK] Import Sorting (gci)..." -ForegroundColor Yellow
2324
if (Test-Path $GCI_BIN) {
24-
# Check only Go files, ignore vendor/modules if present
25-
# Using relative paths for folders to inspect
2625
$gciOut = & $GCI_BIN diff -s standard -s default -s "Prefix(github.com/google/go-github/v82)" github otel example
2726
if ($gciOut) {
2827
Write-Host "[FAIL] Import sorting errors found:" -ForegroundColor Red

0 commit comments

Comments
 (0)