Merge pull request #3850 from medici/task/spotless

AE-5269 | Shivam | Spotless
This commit is contained in:
rahul bhat
2022-09-22 18:34:54 +05:30
committed by GitHub Enterprise
4 changed files with 75 additions and 4 deletions

View 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

View File

@@ -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
View 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
View File

@@ -0,0 +1,7 @@
/*
*
* * Copyright © $YEAR by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/