Merge pull request #3850 from medici/task/spotless
AE-5269 | Shivam | Spotless
This commit is contained in:
30
.github/workflows/android_suggestion.yml
vendored
Normal file
30
.github/workflows/android_suggestion.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Android Suggestion CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ development ]
|
||||
|
||||
jobs:
|
||||
spotless:
|
||||
|
||||
runs-on: [ self-hosted ]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Fetch origin/development
|
||||
run: git fetch origin development
|
||||
- name: set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v2
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- run: ./gradlew spotlessApply
|
||||
- uses: reviewdog/action-suggester@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tool_name: spotless
|
||||
10
build.gradle
10
build.gradle
@@ -36,6 +36,12 @@ buildscript {
|
||||
apply from: 'dependencies.gradle'
|
||||
}
|
||||
|
||||
plugins {
|
||||
id('com.diffplug.spotless') version('6.11.0')
|
||||
}
|
||||
|
||||
apply from: "$project.rootDir/spotless.gradle"
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
@@ -93,7 +99,3 @@ allprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
32
spotless.gradle
Normal file
32
spotless.gradle
Normal file
@@ -0,0 +1,32 @@
|
||||
spotless {
|
||||
ratchetFrom 'origin/development'
|
||||
|
||||
format 'misc', {
|
||||
target '**/*.gradle', '**/*.md', '**/.gitignore'
|
||||
|
||||
trimTrailingWhitespace()
|
||||
indentWithSpaces()
|
||||
endWithNewline()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
target '**/*.kt'
|
||||
|
||||
licenseHeaderFile rootProject.file('spotless.license')
|
||||
trimTrailingWhitespace()
|
||||
indentWithSpaces()
|
||||
endWithNewline()
|
||||
ktfmt().kotlinlangStyle()
|
||||
}
|
||||
|
||||
java {
|
||||
target '**/*.java'
|
||||
|
||||
licenseHeaderFile rootProject.file('spotless.license')
|
||||
trimTrailingWhitespace()
|
||||
indentWithSpaces()
|
||||
endWithNewline()
|
||||
removeUnusedImports()
|
||||
googleJavaFormat()
|
||||
}
|
||||
}
|
||||
7
spotless.license
Normal file
7
spotless.license
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © $YEAR by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user