Piotr Krzemiński
05/15/2023, 5:30 AMVampire
05/15/2023, 7:04 AMPiotr Krzemiński
05/15/2023, 7:08 AMVampire
05/15/2023, 7:09 AMVampire
05/15/2023, 7:10 AMPiotr Krzemiński
05/15/2023, 7:11 AMAdam S
05/15/2023, 7:22 AM.idea/codeStyles/
).
I’m not a big fan of ktlint and those sort of strict formatters. I find they’re overly pedantic and strict and just get in the way or interrupt the flow, so I haven’t used them.Adam S
05/15/2023, 7:27 AMij_kotlin_name_count_to_use_star_import = 9999
ij_kotlin_name_count_to_use_star_import_for_members = 9999
Piotr Krzemiński
05/15/2023, 8:32 AMEditorConfig is nice because it’s IDE independent.especially the
ij_
properties 😅 but yeah, the overall idea is that it should be IDE-agnostic
we have a conflict of approaches: “IDE takes care of formatting, and it’s not checked by CI” vs. “formatting is enforced by CI, and IDE should produce code that complies with the rules”
personally I’m in favor of the second approach because I want to save time or PR reviews (not care about style too much)Piotr Krzemiński
05/15/2023, 8:40 AMBen Keil
05/15/2023, 10:15 AMPiotr Krzemiński
05/15/2023, 10:20 AMPiotr Krzemiński
05/15/2023, 10:22 AMBen Keil
05/15/2023, 10:27 AMBen Keil
05/15/2023, 10:27 AMBen Keil
05/15/2023, 10:29 AMVampire
05/15/2023, 11:22 AMBen Keil
05/15/2023, 11:22 AMBen Keil
05/15/2023, 11:23 AMVampire
05/15/2023, 11:26 AMBen Keil
05/15/2023, 11:27 AMPiotr Krzemiński
05/15/2023, 11:33 AMVampire
05/15/2023, 11:34 AMktlint
IntelliJ plugin is marked as required for the project.
So everytime you open the project you get a warning that the plugin is missing.
If someone ignores that, he still does not get the plugin.
But the lintKotlin...
task for the ktlint Gradle plugin is also wired to the check
task, so at least if a contributor runs gw check
locally, he would get a failing check and could also use formatKotlin...
tasks to fix up the formatting.Piotr Krzemiński
05/15/2023, 11:35 AMcould also useagain, star imports aren’t automatically fixable (unless you’re describing a desired state)tasks to fix up the formatting.formatKotlin...
Vampire
05/15/2023, 11:42 AMij_kotlin_packages_to_use_import_on_demand = unset
in editor config: https://pinterest.github.io/ktlint/0.49.1/rules/standard/#no-wildcard-importsPiotr Krzemiński
05/15/2023, 11:45 AMVampire
05/15/2023, 12:08 PMlibrary:lintKotlinMain
fails with a star-import even without that editorconfig setting, so 🤷Piotr Krzemiński
05/15/2023, 12:10 PMVampire
05/15/2023, 12:15 PMij_kotlin_packages_to_use_import_on_demand = unset
ij_kotlin_name_count_to_use_star_import = 9999
ij_kotlin_name_count_to_use_star_import_for_members = 9999
to editor config, IntelliJ also properly uses no start imports and then is consistent with the ktlint check.Vampire
05/15/2023, 12:15 PMVampire
05/15/2023, 12:20 PMij_kotlin_packages_to_use_import_on_demand = unset
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
Piotr Krzemiński
05/15/2023, 12:34 PMPiotr Krzemiński
05/15/2023, 12:47 PMBen Keil
05/15/2023, 1:10 PMPiotr Krzemiński
05/15/2023, 2:27 PMPaul Dingemans
05/16/2023, 4:22 PMwhich I also wanted to report here. In addition to that it would be best to also minimise thein editor config: https://pinterest.github.io/ktlint/0.49.1/rules/standard/#no-wildcard-importsij_kotlin_packages_to_use_import_on_demand = unset
.idea/codeStyles/*
configuration as described on https://pinterest.github.io/ktlint/0.49.1/rules/configuration-intellij-idea/