Skip to content

Commit

Permalink
feat: drop support for golangcilint
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Use golangci-lint hook rather than golangcilint.
  • Loading branch information
dgschwindturo committed Sep 11, 2023
1 parent 72ce75f commit a7e6129
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 34 deletions.
6 changes: 0 additions & 6 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
entry: --entrypoint go-fmt.sh ghcr.io/turo/pre-commit-hooks/gotools:1.0.0
language: docker_image
files: '\.go$'
- id: golangcilint
name: "golangcilint: Lint all the things (docker)"
description: "Runs `golangci-lint`, a meta-linter which comprises many others, in docker"
entry: ghcr.io/turo/pre-commit-hooks/golangci_lint:1.43.0
language: docker_image
files: \.go$
# Hooks that run locally only, and require golang
- id: go-test-unit
name: "go-test-unit: Run tagged unit tests"
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ This section tells you how to install.

First you must have [pre-commit](https://pre-commit.com/) installed and configured.

The pre-commit hooks which start with `go-` require that the [golang environment
The pre-commit hooks in this section require that the [golang environment
be installed](https://golang.org/doc/install) to run successfully:

- go-test-unit
- go-build
- golangci-lint
- go-mod-tidy
- go-vet
- go-fmt
Expand All @@ -39,7 +40,6 @@ installed](https://docs.docker.com/get-docker/) to run successfully:
- gocyclo
- goimports
- gofmt
- golangci-lint

### Hooks installation

Expand All @@ -49,7 +49,7 @@ in this example, some of the hooks enabled would be redundant.
```yaml
repos:
- repo: https://github.com/turo/pre-commit-hooks
rev: v3.0.0 # You may version pin this if desired
rev: v3.5.0 # You may version pin this if desired
hooks:
- id: go-test-unit
- id: go-build
Expand Down Expand Up @@ -77,8 +77,6 @@ The following hooks are available:
other linters, may be slow to run the first time, but uses caching within the
repository to speed up the container on subsequent runs. **This should be your
preferred Golang linter unless its just plain too slow.**
- **golangcilint** (_requires docker_) - Same as golangci-lint, but runs in a
docker container.
- **gocyclo** (_requires docker_) - Cyclomatic complexity checker
- **goimports** (_requres docker_) - Superceded `go fmt` as the Go style formatter
- **gofmt** (_requires docker_) - Original Go style formatter, a bit more relaxed
Expand All @@ -103,7 +101,7 @@ A typical `pre-commit-config.yaml` for a Golang project would look like this:
```yaml
repos:
- repo: https://github.com/turo/pre-commit-hooks
rev: v3.0.0 # You may version pin this if desired
rev: v3.5.0 # You may version pin this if desired
hooks:
- id: go-mod-tidy # Clean up go.mod
- id: go-build # Check compilation
Expand Down
15 changes: 0 additions & 15 deletions containers/golangci_lint/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions containers/golangci_lint/docker-compose.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions docs/breaking-changes/v4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Breaking Changes in v4

The `golangcilint` hook will no longer be supported in favor of using the `golangci-lint` hook instead. The latter
is put in place via the `packer-github-actions-general` repo.
1 change: 0 additions & 1 deletion versions.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ docker_compose_version=1.29.2
gocyclo_version=0.3.1
goimports_version=0.1.5
golang_version=1.16-buster
golangci_lint_version=1.43.0
gosec_version=2.8.1
gotools_version=1.0.0
pre_commit_version=2.13.0

0 comments on commit a7e6129

Please sign in to comment.