From aa7cb3cc6078a35a6e5a8a77aa223aac88a2c9c5 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 13 Sep 2023 15:58:46 -0700 Subject: [PATCH 1/5] make: Fix pwd for Windows `$(shell pwd)` doesn't work on Windows as-is. Use MAKEFILE_LIST to get the path to the Makefile, and then work back to find the directory from that. This is cross-platform. Also make the Makefile always run the bash shell, so we it doesn't try to powershell anything. Lastly, make the cff, mockgen, staticcheck, and mdox targets relative to the directory rather than absolute. Their absolute paths aren't necessary; bin is added to the PATH so just their names can be used directly. --- Makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index dfb6b89..a0f1de8 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,18 @@ -export GOBIN = $(shell pwd)/bin +SHELL = /bin/bash + +# Cross-platform way to find the directory holding this Makefile. +PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + +export GOBIN = $(PROJECT_ROOT)/bin export PATH := $(GOBIN):$(PATH) MODULES ?= . ./examples ./internal/tests ./tools ./docs TEST_FLAGS ?= -race -CFF = $(GOBIN)/cff -MOCKGEN = $(GOBIN)/mockgen -STATICCHECK = $(GOBIN)/staticcheck -MDOX = $(GOBIN)/mdox +CFF = bin/cff +MOCKGEN = bin/mockgen +STATICCHECK = bin/staticcheck +MDOX = bin/mdox # 'make cover' should not run on docs by default. # We run that separately explicitly on a specific platform. From 101d38041a999dbbcdf051b01b0c072b6b16974a Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 13 Sep 2023 16:09:08 -0700 Subject: [PATCH 2/5] doc(CONTRIBUTING): Fix contributing code link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0009324..4318b4b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ feel free to [start a new discussion](https://github.com/uber-go/cff/discussions instead and we'll assist you if we can. ## Contributing Code -Before contributing code, please follow [these steps](#new-functionality). +Before contributing code, please follow [these steps](#contributing-ideas). When your feature is accepted by maintainers, follow these steps: From 60d99e3db17f3003df893f8c18940d18a847ca05 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 13 Sep 2023 16:12:10 -0700 Subject: [PATCH 3/5] mdox: Ignore pkg.go.dev links for now --- docs/.mdox-validate.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/.mdox-validate.yaml b/docs/.mdox-validate.yaml index b32f700..0dd8592 100644 --- a/docs/.mdox-validate.yaml +++ b/docs/.mdox-validate.yaml @@ -8,3 +8,7 @@ validators: type: 'githubPullsIssues' - regex: '(^http[s]?:\/\/)(www\.)?(github\.com\/)uber-go\/cff(\/discussions\/)' type: 'ignore' + + # Ignore pkg.go.dev links until release. + - regex: '(^http[s]?:\/\/)(pkg\.)?(go\.dev\/)' + type: 'ignore' From f4d2374008783c7b698028ced11328857f88acd6 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 13 Sep 2023 16:15:38 -0700 Subject: [PATCH 4/5] docs: make fmt --- CONTRIBUTING.md | 1 + docs/get-started/flow.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4318b4b..c05b57d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,6 +28,7 @@ feel free to [start a new discussion](https://github.com/uber-go/cff/discussions instead and we'll assist you if we can. ## Contributing Code + Before contributing code, please follow [these steps](#contributing-ideas). When your feature is accepted by maintainers, follow these steps: diff --git a/docs/get-started/flow.md b/docs/get-started/flow.md index de44a1b..a3c157a 100644 --- a/docs/get-started/flow.md +++ b/docs/get-started/flow.md @@ -261,7 +261,6 @@ Now let's actually make requests to this interface. fmt.Println(res.Driver, "drove", res.Rider, "who lives in", res.HomeCity) ``` - 15. Finally, run `go generate` again. You should see a message similar to the following. From d333d048d8fdc0da49a7511f2c44faa85f6eb171 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 13 Sep 2023 16:20:57 -0700 Subject: [PATCH 5/5] Drop windows support; will re-add in #54 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2de8356..bc7c216 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ["ubuntu-latest", "windows-latest"] + os: ["ubuntu-latest"] go: ["1.18.x", "1.19.x"] include: - go: 1.19.x