diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a5d5387 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +[*] +charset=utf-8 +end_of_line=lf +insert_final_newline=false +indent_style=space +indent_size=4 +max_line_length=150 + diff --git a/Dangerfile b/Dangerfile index 955ec05..9c86d0e 100644 --- a/Dangerfile +++ b/Dangerfile @@ -25,7 +25,19 @@ has_milestone = github.pr_json["milestone"] != nil message("This PR does not refer to an existing milestone", sticky: false) unless has_milestone # Ignore issues out of PR scope -# github.dismiss_out_of_range_messages +github.dismiss_out_of_range_messages({ + error: false, + warning: false, + message: true, + markdown: true +}) + +# Ktlint +checkstyle_dir = "**/reports/ktlint/ktlint*.xml" +Dir[checkstyle_dir].each do |file_name| + checkstyle_reports.inline_comment = true + checkstyle_reports.report file_name +end # Lint lint_dir = "**/reports/lint-*.xml" @@ -36,13 +48,6 @@ Dir[lint_dir].each do |file_name| android_lint.lint(inline_mode: true) end -# Ktlint -checkstyle_dir = "**/reports/ktlint/*-lint.xml" -Dir[checkstyle_dir].each do |file_name| - checkstyle_format.base_path = file_name - checkstyle_format.report file_name -end - # Unit tests junit_tests_dir = "**/test-results/**/*.xml" Dir[junit_tests_dir].each do |file_name| diff --git a/Gemfile b/Gemfile index fb82b30..6172527 100644 --- a/Gemfile +++ b/Gemfile @@ -6,5 +6,5 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } gem 'danger' gem 'danger-android_lint' -gem "danger-checkstyle_format" +gem "danger-checkstyle_reports" gem 'danger-junit' diff --git a/build.gradle b/build.gradle index ed0933e..ec06158 100644 --- a/build.gradle +++ b/build.gradle @@ -13,10 +13,12 @@ buildscript { classpath 'com.android.tools.build:gradle:3.4.1' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath("org.jmailen.gradle:kotlinter-gradle:1.25.2") + classpath "org.jlleitschuh.gradle:ktlint-gradle:8.0.0" } } +ext.ReporterType = org.jlleitschuh.gradle.ktlint.reporter.ReporterType + allprojects { repositories { google() diff --git a/core/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview/core/views/BaseViewHolder.kt b/core/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview/core/views/BaseViewHolder.kt index 03d9523..1447e41 100644 --- a/core/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview/core/views/BaseViewHolder.kt +++ b/core/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview/core/views/BaseViewHolder.kt @@ -1,9 +1,9 @@ package com.github.stephenvinouze.advancedrecyclerview.core.views -import androidx.recyclerview.widget.RecyclerView import android.view.View +import androidx.recyclerview.widget.RecyclerView /** * Created by Stephen Vinouze on 04/11/2015. */ -open class BaseViewHolder(val view: View) : RecyclerView.ViewHolder(view) +open class BaseViewHolder(val view: View) : RecyclerView.ViewHolder(view) \ No newline at end of file diff --git a/ktlint.gradle b/ktlint.gradle new file mode 100644 index 0000000..fc98e64 --- /dev/null +++ b/ktlint.gradle @@ -0,0 +1,9 @@ +apply plugin: "org.jlleitschuh.gradle.ktlint" + +ktlint { + version = "0.32.0" + android = true + ignoreFailures = true + enableExperimentalRules = true + reporters = [ReporterType.CHECKSTYLE] +} diff --git a/library.gradle b/library.gradle index 25bd471..ea0d906 100644 --- a/library.gradle +++ b/library.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'org.jmailen.kotlinter' +apply from: '../ktlint.gradle' group = 'com.github.stephenvinouze' diff --git a/sample/build.gradle b/sample/build.gradle index 40cd1a2..4f7731d 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' -apply plugin: 'org.jmailen.kotlinter' +apply from: '../ktlint.gradle' android { compileSdkVersion Integer.parseInt(ANDROID_BUILD_SDK_VERSION) @@ -32,11 +32,11 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0' testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' } \ No newline at end of file