Skip to content

Commit

Permalink
Switch to core20 and build from source
Browse files Browse the repository at this point in the history
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
alexmurray committed May 25, 2022
1 parent 24b3efa commit ed627a4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 68 deletions.
38 changes: 0 additions & 38 deletions snap/plugins/fetch_golangci_lint.py

This file was deleted.

30 changes: 0 additions & 30 deletions snap/snapcraft.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions snapcraft.yaml
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

0 comments on commit ed627a4

Please sign in to comment.