Skip to content

build: make lint non-mutating - #371

Merged
theletterf merged 1 commit into
mainfrom
chore/make-lint-read-only
Sep 25, 2026
Merged

theletterf merged 1 commit into
mainfrom
chore/make-lint-read-only

Conversation

@theletterf

@theletterf theletterf commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

PR #368 exposed a dangerous mismatch in our local tooling: make lint sounds read-only, but it runs mutating pre-commit hooks directly in the active checkout. With core.symlinks=false, the end-of-file fixer treated a stored symlink target as a text file, appended a newline, and the merged result briefly broke every elastic/docs-actions@v1 consumer.

This PR makes the command match its name. make lint now builds a temporary Git index from the current checkout, including staged, unstaged, deleted, and untracked files. It materializes that snapshot in a disposable worktree with real symlinks, runs every pre-commit hook there, prints proposed changes on failure, and removes the worktree. The active checkout and index are not changed.

I added make format as the explicit mutating command and updated the development command list in the README.

Validation:

  • make lint passed every pre-commit hook with the compiler version pinned by main.
  • The active checkout had the same status before and after make lint.
  • The temporary checkout materialized the tracked retry.js path as a real symlink even though the active repository uses core.symlinks=false.
  • Bash syntax, pre-commit configuration, and git diff --check passed.

This prevents lint fixes from changing a developer or agent checkout. A separate PR adds a CI guard for invalid symlink blobs so that a bad target cannot merge through another path.

Related to #404

@theletterf
theletterf requested a review from a team as a code owner September 24, 2026 19:11
@theletterf theletterf self-assigned this Sep 24, 2026
@theletterf theletterf added the enhancement New feature or request label Sep 24, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved: no actionable issues found.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@theletterf
theletterf merged commit 224c043 into main Sep 25, 2026
14 of 17 checks passed
@theletterf
theletterf deleted the chore/make-lint-read-only branch September 25, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants