-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: improve developer experience for VS Code users
- Loading branch information
1 parent
cdbbef8
commit 75103c2
Showing
9 changed files
with
159 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "golangci-lint", | ||
"pattern": { | ||
"regexp": "^(.+\\.go):(\\d+):(\\d+): \\w+: (.+) \\((\\w+)\\)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4, | ||
"code": 5 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "github.com/stretchr/testify/assert", | ||
"pattern": [ | ||
{ | ||
"regexp": "^\\s+Error Trace:\\s+(.+):(\\d+)$", | ||
"file": 1, | ||
"line": 2 | ||
}, | ||
{ | ||
"regexp": "^\\s+Error:\\s+(.+)(?=:?)", | ||
"message": 1 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"recommendations": [ | ||
"editorconfig.editorconfig", | ||
"github.vscode-github-actions", | ||
"github.vscode-pull-request-github", | ||
"golang.go" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"task.allowAutomaticTasks": "off", | ||
"window.title": "go.strv.io/background${separator}${activeEditorShort}", | ||
"go.lintTool": "golangci-lint", | ||
"go.testTimeout": "5s", | ||
"go.useLanguageServer": true, | ||
"gopls": { | ||
"ui.semanticTokens": true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "make: test", | ||
"detail": "Run the test suite", | ||
"type": "process", | ||
"command": "make", | ||
"args": [ | ||
"test" | ||
], | ||
"problemMatcher": { | ||
"owner": "github.com/stretchr/testify/assert", | ||
"applyTo": "allDocuments", | ||
"fileLocation": [ | ||
"absolute" | ||
], | ||
"pattern": [ | ||
{ | ||
"regexp": "^\\s+Error Trace:\\s+(.+):(\\d+)$", | ||
"file": 1, | ||
"line": 2 | ||
}, | ||
// This is extremely rudimentary because VS Code does not support matching the message across multiple lines | ||
// so this only shows the error but does not show the expected and actual values in the UI 🤦♂️ | ||
{ | ||
"regexp": "^\\s+Error:\\s+(.+)(?=:?)", | ||
"message": 1 | ||
} | ||
] | ||
}, | ||
"isTestCommand": true, | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"clear": true | ||
}, | ||
"icon": { | ||
"id": "beaker", | ||
"color": "terminal.ansiGreen" | ||
} | ||
}, | ||
{ | ||
"label": "make: lint", | ||
"detail": "Run the linter using Docker (golangci-lint)", | ||
"type": "process", | ||
"command": "make", | ||
"args": [ | ||
"lint" | ||
], | ||
"problemMatcher": { | ||
"owner": "golangci-lint", | ||
"applyTo": "allDocuments", | ||
"fileLocation": [ | ||
"relative", | ||
"${workspaceFolder}" | ||
], | ||
"pattern": { | ||
"regexp": "^(.+\\.go):(\\d+):(\\d+): \\w+: (.+) \\((\\w+)\\)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4, | ||
"code": 5 | ||
}, | ||
}, | ||
"group": { | ||
"kind": "test", | ||
"isDefault": false | ||
}, | ||
"presentation": { | ||
"clear": true, | ||
}, | ||
"icon": { | ||
"id": "eye", | ||
"color": "terminal.ansiYellow" | ||
} | ||
}, | ||
{ | ||
"label": "make: clean", | ||
"detail": "Remove compiled and generated files or caches", | ||
"type": "process", | ||
"command": "make", | ||
"args": [ | ||
"clean" | ||
], | ||
"problemMatcher": [], | ||
"presentation": { | ||
"showReuseMessage": false, | ||
"clear": true, | ||
"close": true | ||
}, | ||
"icon": { | ||
"id": "trash", | ||
"color": "terminal.ansiRed" | ||
} | ||
} | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,6 @@ test: force | |
|
||
clean: | ||
rm -rf .cache | ||
rm coverage.txt | ||
|
||
.PHONY: force |