Repository navigation
fix: make .editorconfig actually match the Makefile - #442
Merged
Merged
Conversation
The section header was `[{*.java, Makefile}]`. In EditorConfig glob
syntax whitespace inside braces is significant, so the space after the
comma made the second alternative the literal " Makefile" (with a
leading space). A file named `Makefile` never matched it and fell
through to `[*]`, which sets indent_style = space.
Verified with the editorconfig CLI, before:
$ editorconfig $PWD/Makefile
indent_style=space
indent_size=2
$ editorconfig "$PWD/ Makefile" # the alternative the glob creates
indent_style=tab
indent_size=4
and after:
$ editorconfig $PWD/Makefile
indent_style=tab
indent_size=4
Recipe lines in a Makefile must be tab-indented, so an editor honouring
.editorconfig would have silently reformatted them and broken `make`.
Nothing in the tree needs reformatting: all 98 recipe lines are already
tabs, and the only space-indented lines are inside an `ifdef ComSpec`
conditional block, where make imposes no requirement.
Also drops the caveat AGENTS.md carried about this, which the fix makes
untrue.
Co-Authored-By: Claude Opus 5 (1M context) <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
.editorconfigline 10 is[{*.java, Makefile}]. In EditorConfig glob syntax whitespace inside braces is significant, so the space after the comma makes the second alternative the literal" Makefile"— with a leading space. A file actually namedMakefilenever matches it and falls through to[*], which setsindent_style = space,indent_size = 2.Recipe lines in a Makefile must be tab-indented, so an editor honouring
.editorconfigwould silently reformat them and breakmake. Present since #192 (Jul 2021).Fix is one character:
[{*.java,Makefile}].Verification
Using the
editorconfigCLI, before:after:
No reformatting needed
Nothing in the tree changes as a result: all 98 recipe lines in the Makefile are already tab-indented, and the only 3 space-indented lines sit inside an
ifdef ComSpecconditional block, where make imposes no indentation requirement.Also
Drops the caveat
AGENTS.mdcarried about this glob (added in #432), which this fix makes untrue.Test plan
make teststill works locallySplit out of #432 at @binokaryg's suggestion, to keep that PR docs-only.
🤖 Generated with Claude Code