-
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.
Switch to core20 and build from source
Instead of packaging the upstream release, build it from source so we can avoid issues like golangci/golangci-lint#2649 and golangci/golangci-lint#2673 Signed-off-by: Alex Murray <[email protected]>
- Loading branch information
1 parent
24b3efa
commit ed627a4
Showing
3 changed files
with
37 additions
and
68 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,37 @@ | ||
name: golangci-lint | ||
summary: Fast linters runner for Go | ||
description: | | ||
Runs linters in parallel, uses caching, supports yaml config, has | ||
integrations with all major IDE and has dozens of linters included. | ||
version: 1.46.2 | ||
|
||
base: core20 | ||
confinement: strict | ||
grade: stable | ||
|
||
apps: | ||
golangci-lint: | ||
command: bin/golangci-lint | ||
plugs: | ||
- home | ||
- network | ||
|
||
parts: | ||
golangci-lint: | ||
plugin: go | ||
source: https://github.com/golangci/golangci-lint.git | ||
source-tag: v$SNAPCRAFT_PROJECT_VERSION | ||
build-packages: | ||
- git | ||
- gcc | ||
override-build: | | ||
sed -i s/'"master"'/'"'"$SNAPCRAFT_PROJECT_VERSION"'"'/ cmd/golangci-lint/main.go | ||
sed -i s/'"?"'/'"'$(git rev-parse --short HEAD)'"'/ cmd/golangci-lint/main.go | ||
sed -i s/'""'/'"'$(date -u +%Y-%m-%dT%TZ)'"'/ cmd/golangci-lint/main.go | ||
snapcraftctl build | ||
# golangci-lint requires a go binary in $PATH so use the go snap for this | ||
go: | ||
plugin: nil | ||
stage-snaps: | ||
- go |