Skip to content

troian/pre-commit-golang

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 21 commits ahead of gabriel:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

pre-commit-golang

golang hooks for http://pre-commit.com/

Using these hooks

In your project root dir add this to .pre-commit-config.yaml

-   repo: https://github.com/troian/pre-commit-golang
    sha: HEAD
    hooks:
    -   id: go-fmt
    -   id: go-build
    -   id: go-metalinter
        args:
        - --exclude=corefoundation.go
        - --deadline=60s
        - --vendor
        - --cyclo-over=20
        - --dupl-threshold=100
        - --disable=gotype

Available hooks

Metalinter

  • Runs on all files by default not just changed files (since the metalinter only operates on folders)
  • Use args to override default options

About

pre-commit hooks fot golang

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%