Skip to content

Support editorconfig when using stdin - #670

Merged
AbdullinAM merged 5 commits into
Kotlin:mainfrom
ZacSweers:z/editorConfigPath
Aug 17, 2026
Merged

AbdullinAM merged 5 commits into
Kotlin:mainfrom
ZacSweers:z/editorConfigPath

Conversation

@ZacSweers

Copy link
Copy Markdown
Contributor

This PR adds support for, when formatting source from stdin, use --stdin-name as the logical source path for EditorConfig lookup. This lets tools format virtual or staged source content while preserving ancestor EditorConfig settings and path-specific sections.

@AbdullinAM

AbdullinAM commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

Hey! I had to force-update main to fix some leaked !squash commits, can you rebase, please? Sorry for the inconvenience

@ZacSweers

Copy link
Copy Markdown
Contributor Author

Done!

| --google-style Google internal style (2 spaces)
| --kotlinlang-style Kotlin language guidelines style (4 spaces)
| --stdin-name=<name> Name to report when formatting code from stdin
| --stdin-name=<path> Path to report for stdin and, when EditorConfig is

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.

I would suggest keeping the original help message and just add a second part to it: Path to report when formatting code from stdin, also used for EditorConfig lookup if enabled. Just Path to report for stdin is a bit vague

@AbdullinAM
AbdullinAM merged commit 6789008 into Kotlin:main Aug 17, 2026
@AbdullinAM

Copy link
Copy Markdown
Member

Thanks for the contribution!

@ZacSweers
ZacSweers deleted the z/editorConfigPath branch August 17, 2026 19:36
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