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

Commit

Permalink
Fix issue9 (#11)
Browse files Browse the repository at this point in the history
* feat: Add release workflow

* fix: Skip test case
  • Loading branch information
sivchari committed Jul 19, 2022
1 parent 9d4e3d1 commit 0886be1
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/gh-release.yml
@@ -0,0 +1,26 @@
name: gh-release

on:
push:
branches:
- main
paths:
- '**/RELEASE'
pull_request:
types: [opened, synchronize]
branches:
- main
paths:
- '**/RELEASE'

jobs:
gh-release:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pipe-cd/actions-gh-release@v2.3.6
with:
release_file: '**/RELEASE'
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions nosnakecase.go
Expand Up @@ -50,6 +50,12 @@ func report(pass *analysis.Pass, pos token.Pos, name string) {
return
}

// If prefix is Test or Benchmark, Fuzz, skip
// FYI https://go.dev/blog/examples
if strings.Contains(name, "Test") || strings.Contains(name, "Benchmark") || strings.Contains(name, "Fuzz") {
return
}

if strings.Contains(name, "_") {
pass.Reportf(pos, "%s contains underscore. You should use mixedCap or MixedCap.", name)
return
Expand Down
6 changes: 6 additions & 0 deletions release/RELEASE
@@ -0,0 +1,6 @@
tag: v1.5.0
prerelease: false

releaseNoteGenerator:
useReleaseNoteBlock: true
usePullRequestMetadata: true
15 changes: 15 additions & 0 deletions testdata/src/a/a_test.go
@@ -0,0 +1,15 @@
package sandbox_test

import "testing"

func TestX(t *testing.T) {}
func Test_x(t *testing.T) {}
func TestX_x(t *testing.T) {}

func BenchmarkX(b *testing.B) {}
func Benchmark_x(b *testing.B) {}
func BenchmarkX_x(b *testing.B) {}

func FuzzX(f *testing.F) {}
func Fuzz_x(f *testing.F) {}
func FuzzX_x(f *testing.F) {}

0 comments on commit 0886be1

Please sign in to comment.