smithery/JamesPrial

golangci-lint

Configure and run golangci-lint

Installation

$ npx skills add smithery/JamesPrial --skill golangci-lint

Also in this package

Other skills from smithery/JamesPrial · top by installs.

npx skills add smithery/JamesPrial

Browse all from smithery/JamesPrial

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,881 B
  • docs SUMMARY.md 52 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

golangci-lint

Meta-linter that runs multiple linters in parallel.

Install

go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

Usage

golangci-lint run
golangci-lint run ./...
golangci-lint run --fix

Basic Configuration

# .golangci.yml
run:
  timeout: 5m
  tests: true

linters:
  enable:
    - gofmt
    - govet
    - staticcheck
    - errcheck
    - gosimple
    - ineffassign
    - unused

linters-settings:
  errcheck:
    check-blank: true
  govet:
    check-shadowing: true

Recommended Linters

linters:
  enable:
    - gofmt       # Format check
    - govet       # Built-in analyzer
    - staticcheck # Comprehensive checks
    - errcheck    # Unchecked errors
    - gosimple    # Simplification
    - ineffassign # Ineffective assignments
    - unused      # Unused code
    - revive      # Fast configurable linter
    - gocyclo     # Cyclomatic complexity
    - misspell    # Spelling errors

Exclude Patterns

issues:
  exclude-rules:
    - path: _test\.go
      linters:
        - errcheck
        - gosec
    - text: "should have comment"
      linters:
        - revive

CI Integration

# GitHub Actions
golangci-lint run --out-format=github-actions

# GitLab CI
golangci-lint run --out-format=code-climate > gl-code-quality-report.json

Common Fixes

errcheck: Unchecked Error

// Bad
file.Close()

// Good
defer file.Close()

gosimple: Redundant Code

// Bad
for i, _ := range items

// Good
for i := range items

ineffassign: Ineffective Assignment

// Bad
result := compute()
result = other()

// Good
result := other()

Performance Tuning

run:
  concurrency: 4
  deadline: 5m
  skip-dirs:
    - vendor
    - third_party