Skip to content

editorconfig and formatting - #326

Merged
smelfungus merged 2 commits into
masterfrom
chore/editorconfig-and-formatting
Sep 2, 2026
Merged

smelfungus merged 2 commits into
masterfrom
chore/editorconfig-and-formatting

Conversation

@smelfungus

Copy link
Copy Markdown
Member

No description provided.

info/Project.xml was an IntelliJ code style scheme (version 173, so IntelliJ 2017.3) that nothing has ever read: the IDE looks for .idea/codeStyles/Project.xml, no such directory exists here, and no build file, workflow or doc referenced it. It was also actively wrong — it declared 2-space Kotlin indentation while the codebase is 4-space throughout, so importing it and reformatting would have rewritten every file. Most of its bulk was Android XML layout attribute-arrangement rules, and the Compose Multiplatform rewrite left exactly two XML files, both manifests. Its one live setting, KOTLIN_OFFICIAL, is already set by kotlin.code.style in gradle.properties.

.editorconfig takes its place because IntelliJ, Android Studio, VS Code and ktlint all read it, and it can state the trailing-comma preference rather than leaving it to whoever formats next.

.gitattributes pins every text file to LF in the repository, with .bat checked out as CRLF for cmd.exe. It also marks jars, images and fonts binary so no normalisation pass is ever run across them — treating a compressed file as text rewrites bytes inside it and corrupts it silently. kotlin-js-store/wasm/yarn.lock was the only tracked text file still holding CRLF, written that way by yarn on Windows, and is converted here.
A whole-project reformat under the Kotlin official style, plus trailing commas on every multiline parameter and argument list. Both are mechanical: no signature, expression or behaviour changes, which is why it lands in one commit separate from the .editorconfig that now states the rules.

Trailing commas are deliberately absent from `if`, `while`, `for` and `catch` parentheses, where Kotlin rejects them — those are not parameter lists.
@smelfungus smelfungus self-assigned this Sep 2, 2026
@smelfungus
smelfungus merged commit 174dc0f into master Sep 2, 2026
2 checks passed
@smelfungus
smelfungus deleted the chore/editorconfig-and-formatting branch September 2, 2026 02:27
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.

1 participant