mirror of
https://github.com/mgechev/revive.git
synced 2024-11-28 08:49:11 +02:00
Add goreleaser & a gh workflow (#503)
* Add goreleaser & a gh workflow * format code
This commit is contained in:
parent
cc4da66338
commit
f8f4bf23a4
29
.github/workflows/release.yml
vendored
Normal file
29
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
goreleaser:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
-
|
||||||
|
name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.16
|
||||||
|
-
|
||||||
|
name: Run GoReleaser
|
||||||
|
uses: goreleaser/goreleaser-action@v2
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
args: release --rm-dist
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
35
.goreleaser.yml
Normal file
35
.goreleaser.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# This is an example goreleaser.yaml file with some sane defaults.
|
||||||
|
# Make sure to check the documentation at http://goreleaser.com
|
||||||
|
---
|
||||||
|
archives:
|
||||||
|
-
|
||||||
|
replacements:
|
||||||
|
386: i386
|
||||||
|
amd64: x86_64
|
||||||
|
darwin: Darwin
|
||||||
|
linux: Linux
|
||||||
|
windows: Windows
|
||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- "go mod download"
|
||||||
|
- "go generate ./..."
|
||||||
|
builds:
|
||||||
|
-
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- darwin
|
||||||
|
- windows
|
||||||
|
|
||||||
|
changelog:
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- "^docs:"
|
||||||
|
- "^test:"
|
||||||
|
sort: asc
|
||||||
|
checksum:
|
||||||
|
name_template: checksums.txt
|
||||||
|
snapshot:
|
||||||
|
name_template: "{{ .Tag }}-next"
|
||||||
|
project_name: revive
|
@ -22,8 +22,8 @@ func (r *BlankImportsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failu
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
message = "a blank import should be only in a main or test package, or have a comment justifying it"
|
message = "a blank import should be only in a main or test package, or have a comment justifying it"
|
||||||
category = "imports"
|
category = "imports"
|
||||||
|
|
||||||
embedImportPath = `"embed"`
|
embedImportPath = `"embed"`
|
||||||
)
|
)
|
||||||
|
@ -168,7 +168,7 @@ func (w lintStructTagRule) checkJSONTag(name string, options []string) (string,
|
|||||||
case "":
|
case "":
|
||||||
// special case for JSON key "-"
|
// special case for JSON key "-"
|
||||||
if name != "-" {
|
if name != "-" {
|
||||||
return "option can not be empty in JSON tag", false
|
return "option can not be empty in JSON tag", false
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return fmt.Sprintf("unknown option '%s' in JSON tag", opt), false
|
return fmt.Sprintf("unknown option '%s' in JSON tag", opt), false
|
||||||
|
Loading…
Reference in New Issue
Block a user