diff options
author | 2022-02-17 12:12:03 -0800 | |
---|---|---|
committer | 2022-02-17 15:12:03 -0500 | |
commit | 5bb8947309eeb3b677c5a3eecc920fdfe6addd6e (patch) | |
tree | 4c8e65fa53d00668b5a4af39998522e1f6dad36f | |
parent | 35e20700097c992264891fe239d348952d881633 (diff) | |
download | coredns-5bb8947309eeb3b677c5a3eecc920fdfe6addd6e.tar.gz coredns-5bb8947309eeb3b677c5a3eecc920fdfe6addd6e.tar.zst coredns-5bb8947309eeb3b677c5a3eecc920fdfe6addd6e.zip |
Add Reviewdog to suggestion gofmt and whitespace changes in pull request (#5155)
use reviewdog to automatically suggest whitespace corrections in PRs
so that code will be clean before committing into master branch.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
-rw-r--r-- | .github/workflows/reviewdog.yml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml new file mode 100644 index 000000000..a64aaaad9 --- /dev/null +++ b/.github/workflows/reviewdog.yml @@ -0,0 +1,23 @@ +name: Reviewdog + +on: + pull_request: + branches: + - master + +jobs: + gofmt: + name: Go Fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: find . -not -path '*/\.git/*' -type f -name '*.go' -exec gofmt -s -w {} \+ + - uses: reviewdog/action-suggester@v1 + + whitespace: + name: Whitespace + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: find . -not -path '*/\.git/*' -type f -not -name '*.go' -exec sed -i 's/[[:space:]]\{1,\}$//' {} \+ + - uses: reviewdog/action-suggester@v1 |