-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,808 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text=auto eol=lf | ||
*.{cmd,[cC][mM][dD]} text eol=crlf | ||
*.{bat,[bB][aA][tT]} text eol=crlf |
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 |
---|---|---|
|
@@ -7,6 +7,22 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
goyek: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: '1.22' | ||
check-latest: true | ||
- run: ./goyek.sh -v ci | ||
# TODO: Uncomment after making the repository public. | ||
# - uses: codecov/[email protected] | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# fail_ci_if_error: true | ||
# file: ./coverage.out | ||
|
||
check-links: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
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,40 @@ | ||
# Tools binaries | ||
.tools/ | ||
|
||
# Testing results | ||
test-results/ | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
# Go workspace files | ||
go.work | ||
go.work.sum | ||
|
||
# IDEs | ||
.idea/ | ||
.vscode/ | ||
|
||
# VIM | ||
[._]*.s[a-v][a-z] | ||
!*.svg | ||
[._]*.sw[a-p] | ||
[._]s[a-rt-v][a-z] | ||
[._]ss[a-gi-z] | ||
[._]sw[a-p] | ||
|
||
# macOS | ||
.DS_Store |
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,60 @@ | ||
run: | ||
timeout: 5m | ||
|
||
linters-settings: | ||
depguard: | ||
rules: | ||
non-tests: | ||
files: | ||
- "!$test" | ||
- "!**/*test/*.go" | ||
deny: | ||
- pkg: "testing" | ||
- pkg: "github.com/stretchr/testify" | ||
govet: | ||
disable: | ||
- composites | ||
gosec: | ||
excludes: | ||
- G404 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- depguard | ||
- dupl | ||
- durationcheck | ||
- errorlint | ||
- errname | ||
- exportloopref | ||
- forbidigo | ||
- gci | ||
- goconst | ||
- gofmt | ||
- gofumpt | ||
- goheader | ||
- goimports | ||
- gomodguard | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nilerr | ||
- noctx | ||
- prealloc | ||
- predeclared | ||
- revive | ||
- staticcheck | ||
- stylecheck | ||
- thelper | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- wastedassign | ||
- whitespace |
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,10 @@ | ||
# Default state for all rules | ||
default: true | ||
|
||
# allow hard-tabs | ||
MD010: false | ||
|
||
# allow long lines for tables and code blocks | ||
MD013: | ||
code_blocks: false | ||
tables: 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
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,29 @@ | ||
// Copyright Splunk Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package main | ||
|
||
import "github.com/goyek/goyek/v2" | ||
|
||
var all = goyek.Define(goyek.Task{ | ||
Name: "all", | ||
Usage: "build pipeline", | ||
Deps: goyek.Deps{ | ||
mod, | ||
spell, | ||
mdlint, | ||
golint, | ||
test, | ||
}, | ||
}) |
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,26 @@ | ||
// Copyright Splunk Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package main | ||
|
||
import "github.com/goyek/goyek/v2" | ||
|
||
var _ = goyek.Define(goyek.Task{ | ||
Name: "ci", | ||
Usage: "build pipeline used by CI server", | ||
Deps: goyek.Deps{ | ||
all, | ||
diff, | ||
}, | ||
}) |
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,28 @@ | ||
// Copyright Splunk Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/goyek/goyek/v2" | ||
"github.com/goyek/x/cmd" | ||
) | ||
|
||
var _ = goyek.Define(goyek.Task{ | ||
Name: "clean", | ||
Usage: "remove git ignored files", | ||
Action: func(a *goyek.A) { | ||
cmd.Exec(a, "git clean -fXd") | ||
}, | ||
}) |
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,38 @@ | ||
// Copyright Splunk Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package main | ||
|
||
import ( | ||
"io" | ||
"strings" | ||
|
||
"github.com/goyek/goyek/v2" | ||
"github.com/goyek/x/cmd" | ||
) | ||
|
||
var diff = goyek.Define(goyek.Task{ | ||
Name: "diff", | ||
Usage: "git diff", | ||
Action: func(a *goyek.A) { | ||
cmd.Exec(a, "git diff --exit-code") | ||
|
||
sb := &strings.Builder{} | ||
out := io.MultiWriter(a.Output(), sb) | ||
cmd.Exec(a, "git status --porcelain", cmd.Stdout(out), cmd.Stderr(out)) | ||
if sb.Len() > 0 { | ||
a.Error("git status --porcelain returned output") | ||
} | ||
}, | ||
}) |
Oops, something went wrong.