Fix lint error when go.mod is not present in root#18
Fix lint error when go.mod is not present in root#18
Conversation
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on masihyeganeh, metalarm10, TxCorpi0x, and ysv).
build/golang/lint.go line 64 at r2 (raw file):
} workFilePath := filepath.Join(repoPath, "go.work")
have you tested this against tx-chain ? i was not able to get it to run it successfully.
TxCorpi0x
left a comment
There was a problem hiding this comment.
@TxCorpi0x made 1 comment.
Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on masihyeganeh, metalarm10, miladz68, and ysv).
build/golang/lint.go line 64 at r2 (raw file):
Previously, miladz68 (milad) wrote…
have you tested this against tx-chain ? i was not able to get it to run it successfully.
The fix has changed and the code is refactored, tested with tx-chain, tx-bridge-xrpl, tx-crust itself
Description
This pull request significantly updates the Go linter logic in
build/golang/lint.goto better support repositories using ago.workworkspace. The new approach parses thego.workfile to identify all modules, filters out those without Go code, and then runs the linter on the relevant modules in a single command. This streamlines linting for multi-module repositories and improves logging and error handling.Go workspace and linter improvements:
go.workfile using the newparseGoWorkfunction, which runsgo work edit -jsonand extracts module paths. This enables linting across all modules in a workspace.golangci-lintcommand from the repository root, passing all valid module paths as arguments, rather than running the linter separately for each module.Dependency and import changes:
encoding/jsonimport to support parsing the output ofgo work edit -json.FIXES
Reviewers checklist:
Authors checklist
This change is