Polishes makefile#388
Merged
codefromthecrypt merged 2 commits intomasterfrom Oct 6, 2021
Merged
Conversation
codefromthecrypt
commented
Oct 6, 2021
| format: | ||
| @printf "$(ansi_format_dark)" format "formatting project files" | ||
| # format is a PHONY target, so always runs. This allows skipping when sources didn't change. | ||
| build/format: go.mod $(all_sources) |
Contributor
Author
There was a problem hiding this comment.
format and lint are some of the most expensive parts of the build, and we'd run them always even if sources didn't change before.
| @$(go) run $(golangci_lint) run --timeout 5m --config .golangci.yml ./... | ||
| @$(MAKE) build/lint | ||
| @# this will taint if we are behind from latest binary. printf avoids adding a newline to the file | ||
| @curl -fsSL https://archive.tetratelabs.io/envoy/envoy-versions.json |jq -er .latestVersion|xargs printf "%s" \ |
Contributor
Author
There was a problem hiding this comment.
notably, we always check for latest envoy version as that's not implied by local code.
|
|
||
| # Excludes all *_test.go files. | ||
| gocodes := [!_test].go | ||
| sources := $(wildcard internal/*/*$(gocodes) internal/*/*/*$(gocodes)) |
Contributor
Author
There was a problem hiding this comment.
this was a little loose as it could get sources in the "test" or "testdata" directories (aren't actually used in main)
| gocodes := [!_test].go | ||
| sources := $(wildcard internal/*/*$(gocodes) internal/*/*/*$(gocodes)) | ||
| # Make 3.81 doesn't support '**' globbing: Set explicitly instead of recursion. | ||
| all_patterns := *.go */*.go */*/*.go */*/*/*.go */*/*/*.go */*/*/*/*.go |
Contributor
Author
There was a problem hiding this comment.
if we go past this directory depth I would probably be upset for other reasons :D
| @$(go) mod tidy | ||
| @$(go) run $(licenser) apply -r "Tetrate" | ||
| @$(go)fmt -s -w $$(find . -type f -name '*.go') | ||
| @$(go)fmt -s -w $(all_sources) |
Contributor
Author
There was a problem hiding this comment.
much better than loose shelling out
59ca00a to
9641998
Compare
* tidies how we recursively detect sources * makes lint and formatting conditional on source change * stops requiring gcc for e2e tests * makes formatting consistent * makes non-overridable variable expansion immediate, while keeping macros deferred Signed-off-by: Adrian Cole <adrian@tetrate.io>
9641998 to
6027d84
Compare
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Contributor
Author
|
I'm going to merge this due to holiday schedules, but welcome review feedback later! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.