This repository has been archived by the owner on Jul 26, 2020. It is now read-only.
-
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.
Linting, Pre-Commit, and Release (#20)
* Add golangci-lint with dev+prod config, fixed lint errors. * Re-enable lint * fix lint command * Add goreleaser config and circleci config. Configure version * add go mod tidy pre-commit Co-Authored-By: Dirk Kelly <github@dirkkelly.com>
- Loading branch information
Showing
15 changed files
with
337 additions
and
96 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
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 @@ | ||
(*github.com/spf13/cobra.Command).MarkFlagRequired |
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,30 @@ | ||
run: | ||
# default concurrency is a available CPU number | ||
concurrency: 8 | ||
# timeout for analysis, e.g. 30s, 5m, default is 1m | ||
deadline: 1m | ||
# exit code when at least one issue was found, default is 1 | ||
issues-exit-code: 1 | ||
# include test files or not, default is true | ||
tests: true | ||
skip-dirs: | ||
- .circleci | ||
- .github | ||
|
||
linters: | ||
fast: true | ||
|
||
# all available settings of specific linters | ||
linters-settings: | ||
errcheck: | ||
# path to a file containing a list of functions to exclude from checking | ||
# see https://github.com/kisielk/errcheck#excluding-functions for details | ||
exclude: .errcheck-exclude | ||
|
||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
# Exclude some linters from running on tests files. | ||
- path: _test\.go | ||
linters: | ||
- errcheck |
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,41 @@ | ||
run: | ||
# default concurrency is a available CPU number | ||
concurrency: 8 | ||
# timeout for analysis, e.g. 30s, 5m, default is 1m | ||
deadline: 30s | ||
# exit code when at least one issue was found, default is 1 | ||
issues-exit-code: 1 | ||
# include test files or not, default is true | ||
tests: true | ||
skip-dirs: | ||
- .circleci | ||
- .github | ||
|
||
# output configuration options | ||
output: | ||
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" | ||
format: colored-line-number | ||
# print lines of code with issue, default is true | ||
print-issued-lines: true | ||
# print linter name in the end of issue text, default is true | ||
print-linter-name: true | ||
|
||
linters: | ||
fast: true | ||
enable: | ||
- goimports | ||
|
||
# all available settings of specific linters | ||
linters-settings: | ||
errcheck: | ||
# path to a file containing a list of functions to exclude from checking | ||
# see https://github.com/kisielk/errcheck#excluding-functions for details | ||
exclude: .errcheck-exclude | ||
|
||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
# Exclude some linters from running on tests files. | ||
- path: _test\.go | ||
linters: | ||
- errcheck |
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,55 @@ | ||
project_name: bake | ||
|
||
release: | ||
github: | ||
owner: breadtubetv | ||
name: bake | ||
|
||
before: | ||
hooks: | ||
- go mod download | ||
|
||
builds: | ||
- binary: bake | ||
env: | ||
- CGO_ENABLED=0 | ||
- GO111MODULE=on | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- amd64 | ||
- 386 | ||
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} | ||
|
||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
format: tar.gz | ||
wrap_in_directory: true | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
files: | ||
- LICENSE | ||
- README.md | ||
|
||
checksum: | ||
name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt' | ||
|
||
snapshot: | ||
name_template: SNAPSHOT-{{.Commit}} | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- README | ||
- Merge branch |
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,19 @@ | ||
repos: | ||
- name: Local Validations | ||
repo: local | ||
hooks: | ||
- id: golangci-lint | ||
name: golangci-lint | ||
description: Fast linters runner for Go. | ||
entry: golangci-lint run --fix | ||
types: [go] | ||
language: golang | ||
pass_filenames: false | ||
|
||
- id: gomodtidy | ||
name: gomodtidy | ||
description: Tidy modules. | ||
entry: GO111MODULE=on go mod tidy | ||
types: [go] | ||
language: golang | ||
pass_filenames: false |
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
Oops, something went wrong.