<@U0KBF8D7V> Hi, `ktlint-gradle` plugin author her...
# gradle
j
@Paul Woitaschek Hi,
ktlint-gradle
plugin author here. What are you actually trying to achieve here?
p
Thanks for the plugin btw 😉
I have another issue, maybe you can help me with that: I have a really really long function and can't get to format it correctly
Copy code
inline fun <T1 : Any, T2 : Any, T3 : Any, T4 : Any, T5 : Any, T6 : Any, T7 : Any, T8 : Any, T9 : Any, T10 : Any, T11 : Any, T12 : Any,
    T13 : Any, T14 : Any, R : Any>
    combineLatest(
    source1: ObservableSource<T1>,
    source2: ObservableSource<T2>,
    source3: ObservableSource<T3>,
    source4: ObservableSource<T4>,
    source5: ObservableSource<T5>,
    source6: ObservableSource<T6>,
    source7: ObservableSource<T7>,
    source8: ObservableSource<T8>,
    source9: ObservableSource<T9>,
    source10: ObservableSource<T10>,
    source11: ObservableSource<T11>,
    source12: ObservableSource<T12>,
    source13: ObservableSource<T13>,
    source14: ObservableSource<T14>,
    crossinline combiner: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) -> R
  ): Observable<R> {
    return Observable.combineLatest<Any, R>(
      arrayOf(
        source1,
        source2,
        source3,
        source4,
        source5,
        source6,
        source7,
        source8,
        source9,
        source10,
        source11,
        source12,
        source13,
        source14
      )
    ) {
      @Suppress("UNCHECKED_CAST")
      combiner(
        it[0] as T1,
        it[1] as T2,
        it[2] as T3,
        it[3] as T4,
        it[4] as T5,
        it[5] as T6,
        it[6] as T7,
        it[7] as T8,
        it[8] as T9,
        it[9] as T10,
        it[10] as T11,
        it[11] as T12,
        it[12] as T13,
        it[13] as T14
      )
    }
  }
j
That’s probably more a question for @shyiko Open an issue with the ktlint repo directly. Are you getting some sort of error?
p
It complains about the intendation, but I cant find any way to make intellij autoformat it so that ktLint won't complain @jlleitschuh
j
Did you install the ktlint format settings into intelliJ?
p
Yes
I ran it over the whole codebase and this is the only point where it failed
j
I’d suggest opening an issue with @shyiko’s repo. He responds pretty quickly.
p
He responded quickly, thanks 🙂
Can you tell me why this doesn't work in the root project?
Copy code
tasks.register<GradleBuild>("sth"){
  dependsOn("ktLintCheck")
}
t
Plugin doesn't add "ktlintCheck" or "ktlintFormat" tasks to the root project, unless it has some kotlin code
possibly something like this may work:
Copy code
tasks.register<GradleBuild>("smth") { task ->
     subprojects { sp ->
           def spTask = sp.tasks.findByName("ktlintCheck")
           if (spTask != null) task.dependsOn spTask
     }
}