MyDogTom / ktlint-custom-rules

Custom rules for KtLint
MIT License
0 stars 0 forks source link

Can't download the project 'custom-rules' #3

Open MarinaShaposhnikova opened 5 years ago

MarinaShaposhnikova commented 5 years ago

@MyDogTom Is it still relevant? I have a lot of issues with indentation and wanna use this project, but I can't download it anywhere

error:

Could not find com.github.MyDogTom:ktlint-custom-rules:v0.1.0-RC1.

MarinaShaposhnikova commented 5 years ago

there is no your library here https://plugins.gradle.org/search?term=ktlint

MyDogTom commented 5 years ago

Please follow Usage part from readme: https://github.com/MyDogTom/ktlint-custom-rules#usage If it still not works, please post your setup from build.gradle and your exact error.

I suggest:

MarinaShaposhnikova commented 5 years ago

Nothing new, I just copied and pasted 'Complete (KtLint + custom rules) Gradle configuration'

My error is

`Could not find com.github.MyDogTom:ktlint-custom-rules:v0.1.0-RC1. Searched in the following locations:

MyDogTom commented 5 years ago

Now I see, README has an error. Sorry. Library is not published. You have to use JitPack. For that, add maven { url "https://jitpack.io" } to your repositories block.

MarinaShaposhnikova commented 5 years ago

Thanks, it works.

But anyway incorrect way, have it in console without fix

`> Task :ktlintFormat : Unexpected indentation (-3) (it should be 4) : Unexpected indentation (-3) (it should be 4) : Unexpected indentation (-3) (it should be 4) : Unexpected indentation (1) (it should be 4)

and etc`

MyDogTom commented 5 years ago

Please, provide more information what's wrong. ktlintFormat task should display all errors and fix them. If it's not happening, could you create simple project and share with me? Just your setup + one file that has violation and is not fixed by rule.

MyDogTom commented 5 years ago

Hey @MarinaShaposhnikova Did you manage to apply indentation autocorrection? I'm happy to help, but I need more information.

MarinaShaposhnikova commented 5 years ago

I use file template for generate Kotlin code. when I Use 'format.sh' in Inteliji or in Android Studio everything works fine. E.g. this is my auto-generated class `

class ExampleClass() {

fun doInstances() {        val class1 =
    Class1 (
                            someObject.get(),

    Class2 (

                            someObject.get2(),

    Class3 (

                            someObject.get3()

 )

 )

 )
}

} `

What I want to have

` class ExampleClass() {

fun doInstances() {
    val class1 =
            Class1(
                    someObject.get(),

                    Class2(

                            someObject.get2(),

                            Class3(

                                    someObject.get3()

                            )

                    )

            )
}

} `