Skip to content

build: add make help, pattern-ize docker builds, and fix rubocop binstub - #132

Open
YuseiIto wants to merge 1 commit into
mainfrom
claude/makefile-review-fixes-wp21k4
Open

YuseiIto wants to merge 1 commit into
mainfrom
claude/makefile-review-fixes-wp21k4

Conversation

@YuseiIto

Copy link
Copy Markdown
Owner

Summary

Addresses three review points on the root Makefile:

  1. make help + safe default goal — a self-documenting help target (## comments + awk) is now .DEFAULT_GOAL. Previously a bare make fired the first target (build-pine), kicking off a Docker build unexpectedly.
  2. build-% pattern rule (adds missing build-palm) — the three explicit build-pine/build-bamboo/build-plum recipes collapse into one build-% rule. This restores parity with the CI build matrix and docker/Dockerfile.palm (which had no Make target) and removes the "forgot to add a variant target" failure mode entirely. These build targets are intentionally not .PHONY: GNU Make skips pattern rules for phony targets (a phony build-palm yields Nothing to be done). build-% and build-lxc-% coexist safely via shortest-stem matching.
  3. rubocop binstub generated — mitamae/bin/rubocop recipe now runs bundle binstubs rubocop, so the file target is actually created and bundle install stops re-running on every make lint/make format. The generated bin/ directory is excluded from RuboCop so it no longer lints its own binstub.

Type of Change

  • Other — build tooling (Makefile) and RuboCop config

Platforms Tested

  • N/A (no platform-specific changes)

Checklist

  • bundle exec rubocop passes (verified via make lint: 107 files, no offenses)
  • Idempotent: second make lint skips bundle install (file target satisfied) and runs the binstub directly
  • Platform guards (only_if / not_if) are in place where needed — N/A
  • No secrets or personal tokens are included
  • Documentation updated (if applicable) — N/A

Verification

  • make / make help → prints the target listing, no Docker build
  • make -n build-palm → docker build -t yuseiito-dev:palm -f docker/Dockerfile.palm .
  • make -n build-lxc-pine → sudo scripts/build-lxc.sh pine (collision-safe)
  • make lint run twice → binstub created on first run, bundle install skipped on second; RuboCop reports no offenses

🤖 Generated with Claude Code


Generated by Claude Code

Address three Makefile review points:

- Add a self-documenting `help` target (## comments + awk) and set it as
  `.DEFAULT_GOAL`, so a bare `make` no longer starts a `build-pine` Docker
  build unexpectedly.
- Collapse `build-pine`/`build-bamboo`/`build-plum` into a single `build-%`
  pattern rule, which also adds the previously missing `build-palm` (the palm
  variant already exists in docker/ and the CI matrix) and removes the class
  of "forgot to add a variant target" bugs. These build targets are
  intentionally not `.PHONY`: GNU Make skips pattern rules for phony targets.
- Generate the rubocop binstub with `bundle binstubs rubocop` so the
  `mitamae/bin/rubocop` file target is actually created; previously `bundle
  install` alone never satisfied it, re-running on every lint/format. Exclude
  the generated `bin/` directory from RuboCop so it no longer lints its own
  binstub.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VhbGtHikMteSTrg9seCWsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants