Skip to content

Commit

Permalink
Merge pull request #9 from k1LoW/fix-vet-out
Browse files Browse the repository at this point in the history
Fix pipe ( to catch go vet output )
  • Loading branch information
k1LoW authored Mar 21, 2024
2 parents 850f064 + 8e4b6e8 commit 6ce5865
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: test

on:
push:
branches:
- main
pull_request:

jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out source code
uses: actions/checkout@v4

- name: Set up Go
id: setup-go
uses: actions/setup-go@v5
with:
go-version-file: ./testdata/example/go.mod
check-latest: true

- name: Run gostyle
uses: ./
with:
work-dir: ./testdata/example
reviewdog-filter-mode: nofilter
reviewdog-reporter: github-pr-check
fail-on-error: false
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ runs:
id: pipe
if: inputs.use-reviewdog != 'false'
run: |
echo 'PIPE=| reviewdog -name=${{ inputs.reviewdog-tool-name }} -f=golint -filter-mode="${{ inputs.reviewdog-filter-mode }}" --reporter=${{ inputs.reviewdog-reporter }} --tee' >> "$GITHUB_OUTPUT"
echo 'PIPE=|& reviewdog -name=${{ inputs.reviewdog-tool-name }} -f=golint -filter-mode="${{ inputs.reviewdog-filter-mode }}" --reporter=${{ inputs.reviewdog-reporter }} --tee' >> "$GITHUB_OUTPUT"
shell: bash
- name: Set fail-on-error
id: failonerror
Expand Down
1 change: 1 addition & 0 deletions testdata/example/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module "github.com/k1LoW/gostyle-action/testdata/example"
15 changes: 15 additions & 0 deletions testdata/example/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package main

import "fmt"

type Query interface { // want "gostyle.ifacenames"
Do() error
}

type Getter interface {
GetSomething() // want "gostyle.getters"
}

func main() {
fmt.Println("hello")
}

0 comments on commit 6ce5865

Please sign in to comment.