-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves lint and format to make, managed by bingo (#132)
This removes a few shell scripts and in the process updates linters to more current versions. For example, we were using golangci from 2019. To adjust, some invalid statements were removed. The main part of this change is using https://github.com/bwplotka/bingo as the linters we used were go programs anyway. Bingo generates make entries you can use to on-demang install tools without affecting your go.mod and without shell scripts. Co-authored-by: Takeshi Yoneda <takeshi@tetrate.io> Signed-off-by: Adrian Cole <adrian@tetrate.io>
- Loading branch information
1 parent
250d093
commit a9457a0
Showing
92 changed files
with
256 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
# Ignore everything | ||
* | ||
|
||
# But not these files: | ||
!.gitignore | ||
!*.mod | ||
!README.md | ||
!Variables.mk | ||
!variables.env | ||
|
||
*tmp.mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Project Development Dependencies. | ||
|
||
This is directory which stores Go modules with pinned buildable package that is used within this repository, managed by https://github.com/bwplotka/bingo. | ||
|
||
* Run `bingo get` to install all tools having each own module file in this directory. | ||
* Run `bingo get <tool>` to install <tool> that have own module file in this directory. | ||
* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $(<upper case tool name>) variable where <tool> is the .bingo/<tool>.mod. | ||
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool. | ||
* For go: Import `.bingo/variables.go` to for variable names. | ||
* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies. | ||
|
||
## Requirements | ||
|
||
* Go 1.14+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.4.0. DO NOT EDIT. | ||
# All tools are designed to be build inside $GOBIN. | ||
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST))) | ||
GOPATH ?= $(shell go env GOPATH) | ||
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin | ||
GO ?= $(shell which go) | ||
|
||
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version | ||
# will be used; reinstalling only if needed. | ||
# For example for goimports variable: | ||
# | ||
# In your main Makefile (for non array binaries): | ||
# | ||
#include .bingo/Variables.mk # Assuming -dir was set to .bingo . | ||
# | ||
#command: $(GOIMPORTS) | ||
# @echo "Running goimports" | ||
# @$(GOIMPORTS) <flags/args..> | ||
# | ||
GOIMPORTS := $(GOBIN)/goimports-v0.1.0 | ||
$(GOIMPORTS): $(BINGO_DIR)/goimports.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/goimports-v0.1.0" | ||
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=goimports.mod -o=$(GOBIN)/goimports-v0.1.0 "golang.org/x/tools/cmd/goimports" | ||
|
||
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.38.0 | ||
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/golangci-lint-v1.38.0" | ||
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.38.0 "github.com/golangci/golangci-lint/cmd/golangci-lint" | ||
|
||
LICENSER := $(GOBIN)/licenser-v0.6.0 | ||
$(LICENSER): $(BINGO_DIR)/licenser.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/licenser-v0.6.0" | ||
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=licenser.mod -o=$(GOBIN)/licenser-v0.6.0 "github.com/liamawhite/licenser" | ||
|
||
SHFMT := $(GOBIN)/shfmt-v3.2.4 | ||
$(SHFMT): $(BINGO_DIR)/shfmt.mod | ||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. | ||
@echo "(re)installing $(GOBIN)/shfmt-v3.2.4" | ||
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=shfmt.mod -o=$(GOBIN)/shfmt-v3.2.4 "mvdan.cc/sh/v3/cmd/shfmt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.16 | ||
|
||
require golang.org/x/tools v0.1.0 // cmd/goimports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.16 | ||
|
||
require github.com/golangci/golangci-lint v1.38.0 // cmd/golangci-lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.16 | ||
|
||
require github.com/liamawhite/licenser v0.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT | ||
|
||
go 1.16 | ||
|
||
require mvdan.cc/sh/v3 v3.2.4 // cmd/shfmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.4.0. DO NOT EDIT. | ||
# All tools are designed to be build inside $GOBIN. | ||
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk. | ||
GOBIN=${GOBIN:=$(go env GOBIN)} | ||
|
||
if [ -z "$GOBIN" ]; then | ||
GOBIN="$(go env GOPATH)/bin" | ||
fi | ||
|
||
|
||
GOIMPORTS="${GOBIN}/goimports-v0.1.0" | ||
|
||
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.38.0" | ||
|
||
LICENSER="${GOBIN}/licenser-v0.6.0" | ||
|
||
SHFMT="${GOBIN}/shfmt-v3.2.4" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,7 @@ go.mod | |
go.sum | ||
|
||
*.pem | ||
|
||
.bingo | ||
.dockerignore | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.