feat: add build hygiene - make build, check targets, CI and pre-push hook#351
Merged
Conversation
…hook When functions are added to lib/*-functions, scripts/build must be run to regenerate the aliases, functions, and bash_completion.sh files. This was not discoverable - Makefile only had test targets. Changes: - Add `make build` target to run scripts/build - Add `make check` target to verify generated files are up to date - Add `make clean` to restore generated files to git HEAD - Add `make install-hooks` to set up pre-push hook - Add pre-push git hook (scripts/hooks/pre-push) that runs make check - Add GitHub workflow (.github/workflows/build-check.yml) for CI - Regenerate aliases/functions/completions (includes CloudWatch functions) The CloudWatch functions (cloudwatch-alarms, etc.) were missing from the generated files - this commit includes them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- `make build` now runs quietly and shows a summary: - Function count - Alias count - Changed files (if any) - `make build-verbose` shows full output including docs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
make buildtarget to runscripts/build(generates aliases, functions, bash_completion.sh)make checktarget to verify generated files are up to datemake cleanto restore generated files to git HEADmake install-hooksto set up pre-push git hookscripts/hooks/pre-push) that blocks push if generated files are stale.github/workflows/build-check.yml) to runmake checkon push/PR to masterBackground
When functions are added to
lib/*-functions,scripts/buildmust be run to regenerate the generated files. This wasn't discoverable - the Makefile only had test targets.The CloudWatch functions (
cloudwatch-alarms,cloudwatch-alarm-delete, etc.) were added but the build was never run, so they weren't available when using the alias approach.Test plan
make buildruns successfullymake checkpasses when files are up to datemake checkfails when files are stale (modify a function file, don't run build)make install-hookscreates the pre-push hook🤖 Generated with Claude Code