Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ktlint --apply-to-idea-project overrides Java settings #378

Closed
bgrozev opened this issue Apr 17, 2019 · 2 comments
Closed

ktlint --apply-to-idea-project overrides Java settings #378

bgrozev opened this issue Apr 17, 2019 · 2 comments
Labels

Comments

@bgrozev
Copy link

bgrozev commented Apr 17, 2019

Running ktlint --apply-to-idea-project (ktlint 0.31.0) on my idea project which contains both Java and Kotlin modules results in the Java code style settings in Project.xml being wiped out. Is this intentional?

--- before.xml	2019-04-17 07:32:12.000000000 +0100
+++ after.xml	2019-04-17 07:32:51.000000000 +0100
@@ -10,12 +10,6 @@
       <option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
       <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
     </JetCodeStyleSettings>
-    <codeStyleSettings language="JAVA">
-      <option name="BRACE_STYLE" value="2" />
-      <option name="CLASS_BRACE_STYLE" value="2" />
-      <option name="METHOD_BRACE_STYLE" value="2" />
-      <option name="LAMBDA_BRACE_STYLE" value="2" />
-    </codeStyleSettings>
     <codeStyleSettings language="XML">
       <indentOptions>
         <option name="CONTINUATION_INDENT_SIZE" value="4" />
@@ -23,15 +17,16 @@
     </codeStyleSettings>
     <codeStyleSettings language="kotlin">
       <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
-      <option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
-      <option name="LINE_COMMENT_ADD_SPACE" value="true" />
       <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
       <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
       <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
       <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
+      <option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
+      <option name="LINE_COMMENT_ADD_SPACE" value="true" />
       <indentOptions>
+        <option name="INDENT_SIZE" value="4" />
         <option name="CONTINUATION_INDENT_SIZE" value="4" />
       </indentOptions>
     </codeStyleSettings>
   </code_scheme>
-</component>
\ No newline at end of file
+</component>
@shashachu
Copy link
Contributor

It looks like it's intentional in the sense that it does overwrite the settings, but I think it was an oversight: https://github.com/pinterest/ktlint/blob/master/ktlint/src/main/kotlin/com/github/shyiko/ktlint/internal/IntellijIDEAIntegration.kt#L37

@shashachu shashachu added the bug label Apr 17, 2019
@romtsn
Copy link
Collaborator

romtsn commented Dec 2, 2020

Closing this as we are going to deprecate the current IDEA-integration in favor of integration via .editorconfig (#701)

@romtsn romtsn closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants