Skip to content

Commit 3708571

Browse files
Temporarily disable gci
1 parent dcad6b2 commit 3708571

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
cache: false
6666
- name: Check Format
6767
run: |
68-
go install -v github.com/daixiang0/gci@latest
68+
# go install -v github.com/daixiang0/gci@latest
6969
go install -v mvdan.cc/gofumpt@latest
7070
go run ./infra/vformat/main.go -mode dryrun -pwd ./
7171

infra/vformat/main.go

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func main() {
161161
suffix = ".exe"
162162
}
163163
gofmt := "gofumpt" + suffix
164-
goimports := "gci" + suffix
164+
/* goimports := "gci" + suffix */
165165

166166
if gofmtPath, err := exec.LookPath(gofmt); err != nil {
167167
fmt.Println("Can not find", gofmt, "in system path or current working directory.")
@@ -170,12 +170,12 @@ func main() {
170170
gofmt = gofmtPath
171171
}
172172

173-
if goimportsPath, err := exec.LookPath(goimports); err != nil {
173+
/* if goimportsPath, err := exec.LookPath(goimports); err != nil {
174174
fmt.Println("Can not find", goimports, "in system path or current working directory.")
175175
os.Exit(1)
176176
} else {
177177
goimports = goimportsPath
178-
}
178+
} */
179179

180180
rawFilesSlice := make([]string, 0, 1000)
181181
walkErr := filepath.Walk(pwd, func(path string, info os.FileInfo, err error) error {
@@ -208,33 +208,33 @@ func main() {
208208
gofmtArgs := []string{
209209
"-l", "-e", "-w",
210210
}
211-
goimportsArgs := []string{
211+
/* goimportsArgs := []string{
212212
"write",
213-
}
213+
} */
214214

215215
fmt.Println("Formatting Go source files...")
216216
RunMany(gofmt, gofmtArgs, rawFilesSlice)
217-
RunMany(goimports, goimportsArgs, rawFilesSlice)
217+
/* (goimports, goimportsArgs, rawFilesSlice) */
218218
fmt.Println("Do NOT forget to commit file changes.")
219219
}
220220

221221
if isCheck {
222222
gofmtListArgs := []string{
223223
"-l", "-e",
224224
}
225-
goimportsListArgs := []string{
225+
/* goimportsListArgs := []string{
226226
"list",
227-
}
227+
} */
228228

229229
fmt.Println("Checking files thar are not properly formatted...")
230230
formatRequired := RunMany(gofmt, gofmtListArgs, rawFilesSlice)
231-
formatImportRequired := RunMany(goimports, goimportsListArgs, rawFilesSlice)
231+
/* formatImportRequired := RunMany(goimports, goimportsListArgs, rawFilesSlice) */
232232
if formatRequired {
233233
fmt.Println("Format problem(s) found.")
234234
}
235-
if formatImportRequired {
235+
/* if formatImportRequired {
236236
fmt.Println("Format problem(s) in import found.")
237-
}
237+
} */
238238

239239
if isDryrun {
240240
if formatRequired {
@@ -243,15 +243,16 @@ func main() {
243243
}
244244
RunMany(gofmt, gofmtShowArgs, rawFilesSlice)
245245
}
246-
if formatImportRequired {
246+
/* formatImportRequired {
247247
goimportsShowArgs := []string{
248248
"diff",
249249
}
250250
RunMany(goimports, goimportsShowArgs, rawFilesSlice)
251-
}
251+
} */
252252
}
253253

254-
if formatRequired || formatImportRequired {
254+
/* if formatRequired || formatImportRequired { */
255+
if formatRequired {
255256
fmt.Println("Please run 'go install -v github.com/daixiang0/gci@latest', 'go install -v mvdan.cc/gofumpt@latest', then run 'go run ./infra/vformat/main.go' to format the Go source files.")
256257
os.Exit(1)
257258
} else {

0 commit comments

Comments
 (0)