-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from YAPP-Github/chore/TNT-62
[TNT-62] Lint ์์คํ ์ ์ฉ
- Loading branch information
Showing
20 changed files
with
930 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Android CI | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: zulu | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew build | ||
|
||
- name: Run ktlint, detekt | ||
run: ./gradlew ktlintCheck detekt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package co.kr.tnt | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.jlleitschuh.gradle.ktlint.KtlintExtension | ||
|
||
internal fun Project.configureKtLint() { | ||
extensions.configure<KtlintExtension> { | ||
android.set(true) | ||
verbose.set(true) | ||
outputToConsole.set(true) | ||
additionalEditorconfig.set( | ||
mapOf( | ||
"ktlint_standard_no-wildcard-imports" to "disabled", | ||
"ktlint_standard_filename" to "disabled", | ||
"ktlint_standard_function-naming" to "disabled", | ||
"ktlint_standard_function-signature" to "disabled", | ||
"ktlint_standard_class-naming" to "disabled", | ||
"ktlint_standard_annotation" to "disabled", | ||
"ktlint_standard_blank-line-before-declaration" to "disabled", | ||
"ktlint_standard_string-template-indent" to "disabled", | ||
"ktlint_standard_multiline-expression-wrapping" to "disabled", | ||
"max_line_length" to "120" | ||
) | ||
) | ||
reporters { | ||
reporter(org.jlleitschuh.gradle.ktlint.reporter.ReporterType.PLAIN) | ||
} | ||
} | ||
} | ||
|
||
internal fun Project.configureDetekt() { | ||
with(pluginManager) { | ||
apply("io.gitlab.arturbosch.detekt") | ||
} | ||
|
||
val libs = extensions.libs | ||
dependencies { | ||
"detektPlugins"(libs.findLibrary("detekt.formatting").get()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import co.kr.tnt.configureTest | |
|
||
plugins { | ||
kotlin("jvm") | ||
id("tnt.verify.lint") | ||
} | ||
|
||
configureKotlin() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import co.kr.tnt.configureDetekt | ||
import co.kr.tnt.configureKtLint | ||
|
||
plugins { | ||
id("org.jlleitschuh.gradle.ktlint") | ||
} | ||
|
||
configureKtLint() | ||
configureDetekt() | ||
|
||
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach { | ||
// Target version of the generated JVM bytecode. It is used for type resolution. | ||
jvmTarget = JavaVersion.VERSION_17.majorVersion | ||
|
||
buildUponDefaultConfig = true // preconfigure defaults | ||
allRules = false // activate all available (even unstable) rules. | ||
parallel = true | ||
config.setFrom(listOf(file("$rootDir/config/detekt/detekt.yml"))) // point to your custom config defining rules to run, overwriting default behavior | ||
|
||
reports { | ||
file("$rootDir/build/reports/test/${project.name}/").mkdirs() | ||
html.required.set(true) // observe findings in your browser with structure and code snippets | ||
html.outputLocation.set(file("$rootDir/build/reports/detekt/${project.name}.html")) | ||
xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins | ||
xml.outputLocation.set(file("$rootDir/build/reports/detekt/${project.name}.xml")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.