Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: update golangci config and fix lint errors #1384

Merged
merged 19 commits into from
Aug 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clean up configuration and update workflow
  • Loading branch information
ryanchristo committed Aug 21, 2022
commit fb6a19fecb667c6d56e647a55b41cdfc42fa0071
33 changes: 19 additions & 14 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Lint
# **Why we have it**: Ensures all go files and proto files are
# properly formatted according to lint configuration files.
#
# **What does it impact**: Code cleanliness.
# **What does it impact**: Code quality.

on:
pull_request:
Expand All @@ -28,22 +28,22 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
id: get-diff-app
id: git-diff-app
with:
PATTERNS: app/**/**.go
if: matrix.module == 'app'
- uses: technote-space/get-diff-action@v6
id: get-diff-types
id: git-diff-types
with:
PATTERNS: types/**/**.go
if: matrix.module == 'types'
- uses: technote-space/get-diff-action@v6
id: get-diff-data
id: git-diff-data
with:
PATTERNS: x/data/**/**.go
if: matrix.module == 'x/data'
- uses: technote-space/get-diff-action@v6
id: get-diff-ecocredit
id: git-diff-ecocredit
with:
PATTERNS: x/ecocredit/**/**.go
if: matrix.module == 'x/ecocredit'
Expand All @@ -53,51 +53,56 @@ jobs:
if: env.GIT_DIFF
- uses: golangci/golangci-lint-action@v3
with:
args: --verbose
working-directory: "."
if: steps.get-diff-app.outputs.diff
if: steps.git-diff-app.outputs.diff
- uses: golangci/golangci-lint-action@v3
with:
args: --verbose
working-directory: "types"
if: steps.get-diff-types.outputs.diff
if: steps.git-diff-types.outputs.diff
- uses: golangci/golangci-lint-action@v3
with:
args: --verbose
working-directory: "x/data"
if: steps.get-diff-data.outputs.diff
if: steps.git-diff-data.outputs.diff
- uses: golangci/golangci-lint-action@v3
with:
args: --verbose
working-directory: "x/ecocredit"
if: steps.get-diff-ecocredit.outputs.diff
if: steps.git-diff-ecocredit.outputs.diff

buf-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
id: git_diff
id: git-diff-proto
with:
PATTERNS: |
**/**.proto
- uses: bufbuild/buf-setup-action@v1
if: env.GIT_DIFF
if: steps.git-diff-proto.outputs.diff
- uses: bufbuild/buf-lint-action@v1
with:
input: 'proto'
if: env.GIT_DIFF
if: steps.git-diff-proto.outputs.diff

protolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
id: git-diff-proto
with:
PATTERNS: |
**/**.proto
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
if: env.GIT_DIFF
if: steps.git-diff-proto.outputs.diff
- name: Run protolint
run: |
go install github.com/yoheimuta/protolint/cmd/protolint@latest
protolint .
if: env.GIT_DIFF
if: steps.git-diff-proto.outputs.diff