Skip to content

Commit 000ef84

Browse files
authored
Run go run build/ci.go check_generate (#741)
* Run go run build/ci.go check_generate Unfortunately, the check_generate script doesn't consider eth/ethconfig, so ci can't catch this. * Fix check_generate script and add it to ci
1 parent e482612 commit 000ef84

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ jobs:
194194
- checkout
195195
- run:
196196
command: go run build/ci.go lint
197+
- run:
198+
command: go run build/ci.go check_generate
197199
tidy-geth:
198200
resource_class: small
199201
docker:

build/ci.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ func doCheckGenerate() {
378378

379379
for _, mod := range goModules {
380380
// Compute the origin hashes of all the files
381-
hashes, err := build.HashFolder(mod, []string{"tests/testdata", "build/cache", ".git"})
381+
hashes, err := build.HashFolder(mod, []string{"tests/testdata", "build/cache", ".git", ".jj"})
382382
if err != nil {
383383
log.Fatal("Error computing hashes", "err", err)
384384
}
@@ -388,7 +388,7 @@ func doCheckGenerate() {
388388
c.Dir = mod
389389
build.MustRun(c)
390390
// Check if generate file hashes have changed
391-
generated, err := build.HashFolder(mod, []string{"tests/testdata", "build/cache", ".git"})
391+
generated, err := build.HashFolder(mod, []string{"tests/testdata", "build/cache", ".git", ".jj"})
392392
if err != nil {
393393
log.Fatalf("Error re-computing hashes: %v", err)
394394
}

core/types/gen_receipt_json.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eth/ethconfig/gen_config.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/build/file.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ func HashFolder(folder string, exlude []string) (map[string][32]byte, error) {
4040
res := make(map[string][32]byte)
4141
err := filepath.WalkDir(folder, func(path string, d os.DirEntry, _ error) error {
4242
// Skip anything that's exluded or not a regular file
43-
for _, skip := range exlude {
44-
if strings.HasPrefix(path, filepath.FromSlash(skip)) {
45-
return filepath.SkipDir
43+
if d.IsDir() {
44+
for _, skip := range exlude {
45+
if strings.HasPrefix(path, filepath.FromSlash(skip)) {
46+
return filepath.SkipDir
47+
}
4648
}
4749
}
4850
if !d.Type().IsRegular() {

0 commit comments

Comments
 (0)