From 6b6e78216392f8b70751f7f2e08dbbb260e246e6 Mon Sep 17 00:00:00 2001 From: Vehovec Date: Mon, 9 Oct 2023 09:24:41 +0200 Subject: [PATCH] chore: add ktlint plugin --- android/.editorconfig | 8 ++++++++ android/build.gradle | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 android/.editorconfig diff --git a/android/.editorconfig b/android/.editorconfig new file mode 100644 index 00000000..4307b54b --- /dev/null +++ b/android/.editorconfig @@ -0,0 +1,8 @@ +[*.{kt,kts}] +ktlint_code_style=android_studio +max_line_length=120 +# Allow wildcard imports for react native bridge, since IntelliJ does this automatically when performing +# imports optimization. +ij_kotlin_packages_to_use_import_on_demand = com.facebook.react.bridge.* +ij_kotlin_allow_trailing_comma=true +ij_kotlin_allow_trailing_comma_on_call_site=true diff --git a/android/build.gradle b/android/build.gradle index 0e8fa47d..7ea3b6a7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,19 +2,25 @@ buildscript { ext { kotlinVersion = '1.7.21' androidToolsVersion = '7.4.2' + ktlintVersion = '11.6.0' } repositories { google() mavenCentral() + maven { + url "https://plugins.gradle.org/m2/" + } } dependencies { classpath "com.android.tools.build:gradle:$androidToolsVersion" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" + classpath "org.jlleitschuh.gradle:ktlint-gradle:$ktlintVersion" } } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +apply plugin: 'org.jlleitschuh.gradle.ktlint' repositories { mavenLocal()