go/analysis/passes/gofmt: add gofmt analyzer#621
go/analysis/passes/gofmt: add gofmt analyzer#621cblecker wants to merge 2 commits intogolang:masterfrom
Conversation
|
This PR (HEAD: 2da2e04) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/752020. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Madeline Kalil: Patch Set 1: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Go LUCI: Patch Set 1: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-03-18T19:34:24Z","revision":"b3d97de5013e03a1fcf8ba665fe0a6e4446d890a"} Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Madeline Kalil: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Madeline Kalil: Patch Set 1: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_3771561>) Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Go LUCI: Patch Set 1: This CL has failed the run. Reason: Tryjob golang/try/x_tools-gotip-linux-amd64-race has failed with summary (view all results):
To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Go LUCI: Patch Set 1: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Madeline Kalil: Patch Set 1: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Go LUCI: Patch Set 1: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-03-18T19:52:48Z","revision":"b3d97de5013e03a1fcf8ba665fe0a6e4446d890a"} Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Madeline Kalil: Patch Set 1: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_3771561>) Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Go LUCI: Patch Set 1: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
Message from Go LUCI: Patch Set 1: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
|
This PR (HEAD: cf03fbe) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/752020. Important tips:
|
cf03fbe to
6030ddb
Compare
|
This PR (HEAD: 6030ddb) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/752020. Important tips:
|
|
Message from Christoph Blecker: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/752020. |
6030ddb to
883b46f
Compare
|
This PR (HEAD: 883b46f) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/752020. Important tips:
|
883b46f to
53dd6c7
Compare
Add a new analysis.Analyzer that reports lines whose formatting differs from gofmt's. Each diagnostic includes a suggested fix to apply the correct formatting. The analyzer is registered in gopls as non-default (opt-in) with informational severity, similar to other style-oriented analyzers. Signed-off-by: Christoph Blecker <admin@toph.ca>
Make the gofmt analyzer unexported since new public API requires a proposal. Use the goplsexport trick (as with StdIterators) to make it available to gopls. Signed-off-by: Christoph Blecker <admin@toph.ca>
53dd6c7 to
6b8ae3a
Compare
|
This PR (HEAD: 6b8ae3a) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/752020. Important tips:
|
Add a new analysis.Analyzer that reports lines whose formatting
differs from gofmt's. Each diagnostic includes a suggested fix
to apply the correct formatting.
The analyzer uses format.Source to format each file, then
diff.Lines to compute line-level edits. Generated files
(ast.IsGenerated) are skipped.
It is registered in gopls as non-default (opt-in) with
informational severity, similar to other style-oriented
analyzers.
Fixes golang/go#77910