Allow trailing comma = false for Kotlin not working in IntelliJ IDEA with Kotlinter
I want to forbid trailing commas in my Kotlin code. When I set these lines to false nothing happens and all trailing commas where set to my code and it overwrites hundreds of files.
What I am using:
- IntelliJ IDEA 2022.2.3 (Ultimate Edition)
- Kotlin 1.7.21
- Kotlinter 3.12.0
Here my .editorconfig file in root of my project:
# https://editorconfig.org
root = true
[*.{kt,kts}]
ij_kotlin_allow_trailing_comma=true
ij_kotlin_allow_trailing_comma_on_call_site=true
This is not related to EditorConfig in general, but to the IntelliJ IDEA. You need to report your problem with them.
Der "bug" gehört wie bereits erwähnt ins entsprechende JetBrains Support Forum und nicht hierher, wo lediglich beschrieben wird, welche Einstellungen es allgemein für Editoren gibt, die EditorConfig unterstützen. Da solltest du als "Full Stack Developer" eigentlich auch drauf kommen.
Der Präfix ij_ besagt auch nur, dass du die Code Style Einstellungen aus einer "IntellJ" IDE exportiert hast. Austauschbar sind diese proprietären Parameter dann auch nur mit anderen JetBrains IDE, insofern könntest du auch gleich beim JetBrains .xml Format bleiben.
Ist unter File | Settings | Editor | Code Style auch Enable EditorConfig support aktiviert? Ansonsten gelten weiterhin die Code Styles in der IDE.
Hast du auch keinen anderen Linter / Formatter am Start?
Vielleicht solltest du beim nächsten Mal solch ein drastisches Automatik-Feature erst an einzelnen Dateien durchtesten, bevor du es auf ein ganzes Repo anwendest oder als Pre Commit / Save Task aktivierst und damit (unbesehen) hunderte Dateien zerdröselst.