Skip to content

Commit

Permalink
add golang linter
Browse files Browse the repository at this point in the history
  • Loading branch information
gwen917 committed Sep 6, 2023
1 parent 7168076 commit e00d942
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (C) 2023, Ava Labs, Inc. All rights reserved.
# See the file LICENSE for licensing terms.

name: Run Golang Linter

on:
push:
branches:
- '*'

jobs:
lint_test:
name: Lint
runs-on: ubuntu-20.04

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: awm-relayer

- name: Setup Go
- uses: actions/setup-go@v4
with:
go-version: '1.20.7'
check-latest: true

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
working-directory: .
args: --timeout 10m
29 changes: 29 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures github.com/golangci/golangci-lint.

run:
timeout: 3m
tests: true
# skip auto-generated files.
skip-files:
- ".*mock.*"

issues:
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0

linters:
disable-all: true
enable:
- goconst
- goimports
- gosimple
- govet
- ineffassign
- misspell
- unconvert
- unused
- whitespace

linters-settings:
gofmt:
simplify: true

0 comments on commit e00d942

Please sign in to comment.