Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Find source files once in Makefile targets #4968

Merged
merged 3 commits into from
Nov 9, 2022

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Nov 9, 2022

Small optimizations to the Makefile, like finding source files once.

Also filters out .coderv2/postgres which contains shell files.

@mafredri mafredri self-assigned this Nov 9, 2022
Makefile Outdated
# Source files used for make targets, evaluated on use.
GO_SRC_FILES = $(shell find . -not -path './vendor/*' -type f -name '*.go')
# All the shell files in the repo, excluding ignored files.
SHELL_SRC_FILES = $(shell shfmt -f . | grep -v "\.coderv2/")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we don't have shfmt installed in every single CI run now is a good opportunity to change this to a find instead to avoid "shfmt: command not found" messages in CI.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like shfmt -f because it doesn't rely on file extension, can find scripts without as well. But on the flip side, we don't need that feature and if it simplifies CI then why not 👍🏻.

@mafredri mafredri merged commit 5592f85 into main Nov 9, 2022
@mafredri mafredri deleted the mafredri/makefile-find-source-files-once branch November 9, 2022 16:39
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants