mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-09 23:26:24 -04:00
Add gofumpt-tool.sh script and use it in VS Code
This commit is contained in:
parent
2d4a4dcdc1
commit
9882e4a03e
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"gopls": {
|
||||
"formatting.gofumpt": true,
|
||||
"formatting.gofumpt": false,
|
||||
"ui.diagnostic.staticcheck": true,
|
||||
"ui.diagnostic.analyses": {
|
||||
// This list must match the one in .golangci.yml
|
||||
|
|
@ -24,6 +24,8 @@
|
|||
},
|
||||
"go.alternateTools": {
|
||||
"golangci-lint-v2": "${workspaceFolder}/scripts/golangci-lint-shim.sh",
|
||||
"customFormatter": "${workspaceFolder}/scripts/gofumpt-tool.sh",
|
||||
},
|
||||
"go.lintTool": "golangci-lint-v2",
|
||||
"go.formatTool": "custom",
|
||||
}
|
||||
|
|
|
|||
12
scripts/gofumpt-tool.sh
Executable file
12
scripts/gofumpt-tool.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
# This is used by VSCode; it is not very useful otherwise, since it's easy
|
||||
# enough to just run `go tool gofumpt` directly, or use `just format`.
|
||||
|
||||
set -e
|
||||
|
||||
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
repo_root=$(dirname "$script_dir")
|
||||
|
||||
cd "$repo_root"
|
||||
exec go tool gofumpt "$@"
|
||||
Loading…
Reference in a new issue