Skip to content

fix: make .editorconfig actually match the Makefile - #442

Merged
sugat009 merged 1 commit into
masterfrom
fix-editorconfig-makefile-glob
Sep 27, 2026
Merged

sugat009 merged 1 commit into
masterfrom
fix-editorconfig-makefile-glob

Conversation

@sugat009

Copy link
Copy Markdown
Member

Summary

.editorconfig line 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 named Makefile never matches it and falls through to [*], which sets indent_style = space, indent_size = 2.

Recipe lines in a Makefile must be tab-indented, so an editor honouring .editorconfig would silently reformat them and break make. Present since #192 (Jul 2021).

Fix is one character: [{*.java,Makefile}].

Verification

Using the editorconfig CLI, before:

$ editorconfig $PWD/Makefile
indent_style=space
indent_size=2

$ editorconfig "$PWD/ Makefile"     # the alternative the glob actually creates
indent_style=tab
indent_size=4

after:

$ editorconfig $PWD/Makefile
indent_style=tab
indent_size=4

$ editorconfig $PWD/src/main/java/org/medicmobile/webapp/mobile/MedicLog.java   # control
indent_style=tab
indent_size=4

$ editorconfig $PWD/build.gradle                                               # control
indent_style=space
indent_size=2

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 ComSpec conditional block, where make imposes no indentation requirement.

Also

Drops the caveat AGENTS.md carried about this glob (added in #432), which this fix makes untrue.

Test plan

  • CI green — note this is not a docs-only PR, so Build and Instrumentation will actually run
  • make test still works locally

Split out of #432 at @binokaryg's suggestion, to keep that PR docs-only.

🤖 Generated with Claude Code

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>
@sugat009
sugat009 requested a review from binokaryg September 17, 2026 06:09

@binokaryg binokaryg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@sugat009
sugat009 merged commit 00172e5 into master Sep 27, 2026
8 checks passed
@sugat009
sugat009 deleted the fix-editorconfig-makefile-glob branch September 27, 2026 10:24
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