Skip to content

Commit ed627a4

Browse files
committed
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]>
1 parent 24b3efa commit ed627a4

File tree

3 files changed

+37
-68
lines changed

3 files changed

+37
-68
lines changed

snap/plugins/fetch_golangci_lint.py

-38
This file was deleted.

snap/snapcraft.yaml

-30
This file was deleted.

snapcraft.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: golangci-lint
2+
summary: Fast linters runner for Go
3+
description: |
4+
Runs linters in parallel, uses caching, supports yaml config, has
5+
integrations with all major IDE and has dozens of linters included.
6+
version: 1.46.2
7+
8+
base: core20
9+
confinement: strict
10+
grade: stable
11+
12+
apps:
13+
golangci-lint:
14+
command: bin/golangci-lint
15+
plugs:
16+
- home
17+
- network
18+
19+
parts:
20+
golangci-lint:
21+
plugin: go
22+
source: https://github.com/golangci/golangci-lint.git
23+
source-tag: v$SNAPCRAFT_PROJECT_VERSION
24+
build-packages:
25+
- git
26+
- gcc
27+
override-build: |
28+
sed -i s/'"master"'/'"'"$SNAPCRAFT_PROJECT_VERSION"'"'/ cmd/golangci-lint/main.go
29+
sed -i s/'"?"'/'"'$(git rev-parse --short HEAD)'"'/ cmd/golangci-lint/main.go
30+
sed -i s/'""'/'"'$(date -u +%Y-%m-%dT%TZ)'"'/ cmd/golangci-lint/main.go
31+
snapcraftctl build
32+
33+
# golangci-lint requires a go binary in $PATH so use the go snap for this
34+
go:
35+
plugin: nil
36+
stage-snaps:
37+
- go

0 commit comments

Comments
 (0)