Hello guys, who can help with ktlint? I try to add...
# android
m
Hello guys, who can help with ktlint? I try to add my custom ruleset who can take the time?
w
I just wanted to paste what you did 🙂 What’s the issue with your custom ruleset?
m
I'm trying to use my own set of rules in a separate module, but I don't understand what I'm doing wrong. 1. Created module 2. Copied META, within pointed to path, to his class CustomRuleSetProvider.kt 3. in the main project changed the use of ktlint "com.pinterestktlint0.34.2" on ktlint project(':custom_ktlint_rules')
run the task from main project and get next error: https://gist.github.com/mnewlive/35ee21dc534215946e051d986ad8fd82
Also tried to download the project https://github.com/pinterest/ktlint/tree/master/ktlint-ruleset-template and download .jar file to then use it in your project, also something does not work(
w
Does your
custom_ktlint_rules
module have Android plugin applied in Gradle? If so, I think you should only apply kotlin one, not android
Just like in the sample there’s
Copy code
plugins {
  id 'org.jetbrains.kotlin.jvm'
  id 'java-library'
  id 'maven'
}
m
My gradle file in module https://gist.github.com/mnewlive/aa7c61ac75938e96cfdfbd1a514d467f but i can t added import for my CustomRuleSetProvider
not really understand what should be the build.grade in the module
and then i run my task from main project, again get error
too hard for me 😞
basic one, but may provide hints
m
@tapchicoma i saw this plagin, but problem with my gradle i think
t
you module with custom ruleset should not use any android plugin
👆 1
m
@tapchicoma u mean about
Copy code
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
in build.gradle in module?
t
if you are talking about custom ruleset module
build.gradle
file - yes
m
t
yes, but not android one
m
can I give you access to my project?, I don't see the obvious 100%
t
you could 🙂
m
awesome, can u give your email? i will send you an invitation