Skip to content

Commit

Permalink
Merge pull request #19 from darrenvechain/golangci-linnt-setup-test
Browse files Browse the repository at this point in the history
Golangci linnt setup test
  • Loading branch information
darrenvechain authored Jan 11, 2024
2 parents dbe9923 + 92a32d6 commit 8f63cc1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ current development landscape.

- We follow the [Effective Go](https://golang.org/doc/effective_go) guidelines. Please make sure your code is idiomatic
and follows the guidelines.

### Code Linting

- We employ `golangci-lint` for code linting in our development process. It ensures that code adheres to established standards, and any changes that do not pass the linting checks will trigger an error during the Continuous Integration (CI) process.
- You can run it locally by installing the `golangci-lint` binary and running `golangci-lint run` in the root directory of the repository.
30 changes: 30 additions & 0 deletions .github/workflows/lint-go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
args: --timeout=30m
only-new-issues: true
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true
19 changes: 19 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Please refer to the official golangci-lint config documentation for more details:
# https://golangci-lint.run/usage/configuration/
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml

linters:
enable-all: true

linters-settings:
gci:
sections:
- standard
- default

run:
timeout: 10m
tests: false

issues:
max-issues-per-linter: 1000

0 comments on commit 8f63cc1

Please sign in to comment.