Skip to content

Commit

Permalink
make: moved tooling versioning within a tools/ folder
Browse files Browse the repository at this point in the history
  • Loading branch information
mvisonneau committed Oct 2, 2024
1 parent 94981b6 commit f51acdc
Show file tree
Hide file tree
Showing 7 changed files with 1,844 additions and 20 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,17 @@ jobs:
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: '1.22'
go-version: '1.23'

- name: Install tools
run: make install-tools

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Install goreleaser
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
version: v2.3.2
install-only: true

- name: Run goreleaser
run: make ${{ github.ref == 'refs/heads/main' && 'pre' || '' }}release
env:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: '1.22'
go-version: '1.23'

- name: Install tools
run: make install-tools

- name: Lint
if: ${{ matrix.os == 'ubuntu-22.04' }}
Expand Down
11 changes: 2 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
linters:
enable-all: true
disable:
# Deprecated ones
- golint
- interfacer
- maligned
- scopelint
- ifshort
- nosnakecase
# Deprecated
- gomnd

# We don't want these ones
- depguard
- exhaustivestruct
- forcetypeassert
- gochecknoglobals
- godox
- goerr113
- ireturn
- nakedret
- testpackage
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ COVERAGE_FILE := coverage.out
REPOSITORY := mvisonneau/$(NAME)
.DEFAULT_GOAL := help

.PHONY: install-tools
install-tools: ## Install required tools
@cd tools; grep _ tools.go | awk -F'"' '{print $$2}' | xargs -tI % go install %

.PHONY: fmt
fmt: ## Format source code
go run mvdan.cc/gofumpt@v0.6.0 -w $(shell git ls-files **/*.go)
go run github.com/daixiang0/gci@v0.13.4 write -s standard -s default -s "prefix(github.com/mvisonneau)" .
gofumpt -w $(shell git ls-files **/*.go)
gci write -s standard -s default -s "prefix(github.com/mvisonneau)" .

.PHONY: lint
lint: ## Run all lint related tests upon the codebase
go run github.com/golangci/golangci-lint/cmd/[email protected] run -v --fast
golangci-lint run -v --fast

.PHONY: test
test: ## Run the tests against the codebase
Expand Down
448 changes: 448 additions & 0 deletions tools/go.mod

Large diffs are not rendered by default.

1,369 changes: 1,369 additions & 0 deletions tools/go.sum

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions tools/tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build tools

package tools

import (
_ "github.com/daixiang0/gci"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/goreleaser/goreleaser/v2"
_ "mvdan.cc/gofumpt"
)

0 comments on commit f51acdc

Please sign in to comment.