Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.

Commit 0886be1

Browse files
authored
Fix issue9 (#11)
* feat: Add release workflow * fix: Skip test case
1 parent 9d4e3d1 commit 0886be1

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

.github/workflows/gh-release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: gh-release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**/RELEASE'
9+
pull_request:
10+
types: [opened, synchronize]
11+
branches:
12+
- main
13+
paths:
14+
- '**/RELEASE'
15+
16+
jobs:
17+
gh-release:
18+
runs-on: ubuntu-20.04
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
- uses: pipe-cd/actions-gh-release@v2.3.6
24+
with:
25+
release_file: '**/RELEASE'
26+
token: ${{ secrets.GITHUB_TOKEN }}

nosnakecase.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ func report(pass *analysis.Pass, pos token.Pos, name string) {
5050
return
5151
}
5252

53+
// If prefix is Test or Benchmark, Fuzz, skip
54+
// FYI https://go.dev/blog/examples
55+
if strings.Contains(name, "Test") || strings.Contains(name, "Benchmark") || strings.Contains(name, "Fuzz") {
56+
return
57+
}
58+
5359
if strings.Contains(name, "_") {
5460
pass.Reportf(pos, "%s contains underscore. You should use mixedCap or MixedCap.", name)
5561
return

release/RELEASE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
tag: v1.5.0
2+
prerelease: false
3+
4+
releaseNoteGenerator:
5+
useReleaseNoteBlock: true
6+
usePullRequestMetadata: true

testdata/src/a/a_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package sandbox_test
2+
3+
import "testing"
4+
5+
func TestX(t *testing.T) {}
6+
func Test_x(t *testing.T) {}
7+
func TestX_x(t *testing.T) {}
8+
9+
func BenchmarkX(b *testing.B) {}
10+
func Benchmark_x(b *testing.B) {}
11+
func BenchmarkX_x(b *testing.B) {}
12+
13+
func FuzzX(f *testing.F) {}
14+
func Fuzz_x(f *testing.F) {}
15+
func FuzzX_x(f *testing.F) {}

0 commit comments

Comments
 (0)