-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
138 changed files
with
322 additions
and
245 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,31 +5,16 @@ on: | |
branches: | ||
- main | ||
jobs: | ||
unit-tests: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
go-version: "1.20" | ||
- run: go test -p 1 ./... | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.20" | ||
- name: staticcheck | ||
uses: dominikh/[email protected] | ||
with: | ||
version: "2022.1.1" | ||
quality-checker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
fetch-depth: 1 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.20" | ||
- name: Run the quality checker (which catches obvious mistakes, missing docs, etc.) | ||
run: go run ./.github/quality-checker | ||
go-version: 1.23.x | ||
- name: Make | ||
run: make all |
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 |
---|---|---|
|
@@ -12,3 +12,5 @@ docs/.jekyll-metadata | |
|
||
# Ruby | ||
.ruby-version | ||
|
||
/.tmp/ |
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 |
---|---|---|
@@ -1,5 +1,16 @@ | ||
--- | ||
linters: | ||
enable: | ||
- goimports | ||
- misspell | ||
linters-settings: | ||
errcheck: | ||
check-type-assertions: true | ||
forbidigo: | ||
forbid: | ||
- '^fmt\.Print' | ||
- '^log\.' | ||
- '^print$' | ||
- '^println$' | ||
- '^panic$' | ||
issues: | ||
exclude-dirs-use-default: false | ||
exclude-rules: | ||
- linters: | ||
- staticcheck | ||
text: 'SA1019: "github.com/jhump/protoreflect/desc' |
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,64 @@ | ||
# See https://tech.davis-hansson.com/p/make/ | ||
SHELL := bash | ||
.DELETE_ON_ERROR: | ||
.SHELLFLAGS := -eu -o pipefail -c | ||
.DEFAULT_GOAL := all | ||
MAKEFLAGS += --warn-undefined-variables | ||
MAKEFLAGS += --no-builtin-rules | ||
MAKEFLAGS += --no-print-directory | ||
BIN := .tmp/bin | ||
export PATH := $(abspath $(BIN)):$(PATH) | ||
export GOBIN := $(abspath $(BIN)) | ||
|
||
GO_MOD_GOTOOLCHAIN := go1.23.1 | ||
GOLANGCI_LINT_VERSION := v1.60.3 | ||
# https://github.com/golangci/golangci-lint/issues/4837 | ||
GOLANGCI_LINT_GOTOOLCHAIN := $(GO_MOD_GOTOOLCHAIN) | ||
# If any pins to specific dependency versions are needed, add them here | ||
GO_GET_PKGS := | ||
|
||
.PHONY: help | ||
help: ## Describe useful make targets | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}' | ||
|
||
.PHONY: all | ||
all: ## Build, test, and lint (default) | ||
$(MAKE) test | ||
$(MAKE) lint | ||
|
||
.PHONY: clean | ||
clean: ## Delete intermediate build artifacts | ||
@# -X only removes untracked files, -d recurses into directories, -f actually removes files/dirs | ||
git clean -Xdf | ||
|
||
.PHONY: test | ||
test: build ## Run unit tests | ||
go test -vet=off -race -cover ./... | ||
|
||
.PHONY: build | ||
build: ## Build all packages | ||
go build ./... | ||
|
||
.PHONY: install | ||
install: ## Install all binaries | ||
go install ./... | ||
|
||
.PHONY: lint | ||
lint: $(BIN)/golangci-lint ## Lint | ||
go vet ./... | ||
GOTOOLCHAIN=$(GOLANGCI_LINT_GOTOOLCHAIN) golangci-lint run --modules-download-mode=readonly --timeout=3m0s | ||
go run ./internal/cmd/quality-checker | ||
|
||
.PHONY: lintfix | ||
lintfix: $(BIN)/golangci-lint ## Automatically fix some lint errors | ||
GOTOOLCHAIN=$(GOLANGCI_LINT_GOTOOLCHAIN) golangci-lint run --fix --modules-download-mode=readonly --timeout=3m0s | ||
|
||
.PHONY: upgrade | ||
upgrade: ## Upgrade dependencies | ||
go mod edit -toolchain=$(GO_MOD_GOTOOLCHAIN) | ||
go get -u -t ./... $(GO_GET_PKGS) | ||
go mod tidy -v | ||
|
||
$(BIN)/golangci-lint: Makefile | ||
@mkdir -p $(@D) | ||
GOTOOLCHAIN=$(GOLANGCI_LINT_GOTOOLCHAIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) |
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 |
---|---|---|
@@ -1,34 +1,40 @@ | ||
module github.com/aep-dev/api-linter | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
toolchain go1.23.1 | ||
|
||
require ( | ||
bitbucket.org/creachadair/stringset v0.0.12 | ||
buf.build/gen/go/aep/api/protocolbuffers/go v1.34.2-20240329195937-b433450cc52f.2 | ||
cloud.google.com/go/longrunning v0.5.6 | ||
bitbucket.org/creachadair/stringset v0.0.14 | ||
buf.build/gen/go/aep/api/protocolbuffers/go v1.34.2-20240717204542-6b47820e6610.2 | ||
cloud.google.com/go/longrunning v0.6.1 | ||
github.com/bmatcuk/doublestar/v4 v4.6.1 | ||
github.com/gertd/go-pluralize v0.2.1 | ||
github.com/google/go-cmp v0.6.0 | ||
github.com/jhump/protoreflect v1.15.6 | ||
github.com/jhump/protoreflect v1.17.0 | ||
github.com/lithammer/dedent v1.1.0 | ||
github.com/olekukonko/tablewriter v0.0.5 | ||
github.com/spf13/pflag v1.0.5 | ||
github.com/stoewer/go-strcase v1.3.0 | ||
google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 | ||
google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa | ||
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 | ||
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 | ||
google.golang.org/protobuf v1.34.2 | ||
gopkg.in/yaml.v2 v2.4.0 | ||
) | ||
|
||
require ( | ||
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240221180331-f05a6f4403ce.2 // indirect | ||
github.com/bufbuild/protocompile v0.8.0 // indirect | ||
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2 // indirect | ||
github.com/bufbuild/protocompile v0.14.1 // indirect | ||
github.com/golang/protobuf v1.5.4 // indirect | ||
github.com/mattn/go-runewidth v0.0.9 // indirect | ||
golang.org/x/net v0.21.0 // indirect | ||
golang.org/x/sync v0.6.0 // indirect | ||
golang.org/x/sys v0.17.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect | ||
google.golang.org/grpc v1.62.1 // indirect | ||
github.com/kr/pretty v0.1.0 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/mattn/go-runewidth v0.0.16 // indirect | ||
github.com/rivo/uniseg v0.4.7 // indirect | ||
golang.org/x/net v0.29.0 // indirect | ||
golang.org/x/sync v0.8.0 // indirect | ||
golang.org/x/sys v0.25.0 // indirect | ||
golang.org/x/text v0.18.0 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect | ||
google.golang.org/grpc v1.66.2 // indirect | ||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect | ||
) |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.