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

[FEATURE] - Add golangci-lint GitHub Action #97

Closed
alex1989hu opened this issue Dec 21, 2020 · 1 comment · Fixed by #117
Closed

[FEATURE] - Add golangci-lint GitHub Action #97

alex1989hu opened this issue Dec 21, 2020 · 1 comment · Fixed by #117
Labels
enhancement New feature or request

Comments

@alex1989hu
Copy link

Is your feature request related to a problem? Please describe

Using popular lint tool golangci-lint would help to keep the code cleaner and fix the already existing issues.

Describe the solution you'd like

  • Add .github/workflows/golangci-lint.yml
  • Remove lint, fmt, check-fmt and vet job from .github/workflows/go_test.yml
  • Remove fmt, check-fmt and vet from Makefile
    • Optionally keep lint but to call golangci-lint
  • Create a minimal ~ permissive .golangci.yml as starting point
  • Fix errors reported by the default configuration
  • Enable more linters and fix issues reported by the newly activated linters

Example YAML based on the official repo and on your current workflow https://github.com/golangci/golangci-lint-action#how-to-use

name: golangci-lint
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  golangci:
    strategy:
      matrix:
        go-version:
          - 1.14
          - 1.15
    name: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v2
        with:
          version: v1.33

Describe alternatives you've considered

The code already provides an alternative: golang.org/x/lint/golint

Additional context

N/A

@alex1989hu alex1989hu added the enhancement New feature or request label Dec 21, 2020
@JohnRoesler
Copy link
Contributor

Hey @alex1989hu - thanks for the suggestion. This looks pretty cool. Running it locally I can see some things we should address, and some we already knew about but just haven't gotten around to solving yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants