Repository navigation
build: make lint non-mutating - #371
Merged
Merged
Conversation
There was a problem hiding this comment.
Approved: no actionable issues found.
What is this? | From workflow: PR Review
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
akira28
approved these changes
Sep 25, 2026
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.
PR #368 exposed a dangerous mismatch in our local tooling:
make lintsounds read-only, but it runs mutating pre-commit hooks directly in the active checkout. Withcore.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 everyelastic/docs-actions@v1consumer.This PR makes the command match its name.
make lintnow 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 formatas the explicit mutating command and updated the development command list in the README.Validation:
make lintpassed every pre-commit hook with the compiler version pinned bymain.make lint.retry.jspath as a real symlink even though the active repository usescore.symlinks=false.git diff --checkpassed.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