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

Autoformat doesn't apply to Ktlint Code Style #298

Closed
spipau opened this issue Oct 28, 2019 · 2 comments
Closed

Autoformat doesn't apply to Ktlint Code Style #298

spipau opened this issue Oct 28, 2019 · 2 comments
Labels

Comments

@spipau
Copy link

spipau commented Oct 28, 2019

After upgrading to Version 9.0.0 and changing my Gradle implementation Ktlint fails the build after:

  1. Upgraded to V9.0.0.
  2. Change Gradle implementation as described in readme.
  3. Executed ktlintApplyToIdea Gradle task and restarted IDE.
  4. Executed ktlintFormat and fixed the remaining WildCard Errors with autoformat after ktlintCheck run.
  5. Run again ktlintCheck and the following error can't be resolved with auto-format:

... HelperExtensions.kt:3:1: Imports must be ordered in lexicographic order without any empty lines in-between

The imports in HelperExtensions.kt:

import android.content.Context
import android.graphics.Bitmap
import android.graphics.Color.BLACK
import android.graphics.Color.WHITE
import android.os.Bundle
import android.os.Handler
import android.util.Base64
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
import androidx.annotation.IdRes
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.MutableLiveData
import androidx.navigation.NavController
import androidx.navigation.NavDirections
import androidx.navigation.NavOptions
import androidx.navigation.fragment.FragmentNavigator
import at.risedev.coffeecash.core.R
import at.risedev.coffeecash.core.custom.ErrorDialogFragment
import com.google.zxing.BarcodeFormat
import com.google.zxing.MultiFormatWriter
import com.google.zxing.WriterException
import com.google.zxing.common.BitMatrix
import timber.log.Timber
import java.math.BigDecimal
import java.util.Locale
@Tapchicoma
Copy link
Collaborator

You are affected by this ktlint issue: pinterest/ktlint#527

@spipau
Copy link
Author

spipau commented Nov 27, 2019

I now fixed this issue in version 9.1.1 by adding the following to my .editorconfig (root folder):

[*.{kt,kts}]
disabled_rules=import-ordering

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

2 participants