-
-
Notifications
You must be signed in to change notification settings - Fork 735
style: code formatting and checks in the CI #1120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: code formatting and checks in the CI #1120
Conversation
Thanks for opening this pull request!
|
Codecov Report
@@ Coverage Diff @@
## master #1120 +/- ##
============================================
+ Coverage 65.06% 65.28% +0.21%
- Complexity 2208 2218 +10
============================================
Files 122 122
Lines 9463 9957 +494
Branches 1317 1337 +20
============================================
+ Hits 6157 6500 +343
- Misses 2799 2945 +146
- Partials 507 512 +5
Continue to review full report at Codecov.
|
@mtrezza this is now done. Pipeline will fail if the source code is not formatting well. I have update the |
@mtrezza whenever your okay and ready feel free to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@@ -13,22 +13,53 @@ buildscript { | |||
classpath "org.jacoco:org.jacoco.core:$jacocoVersion" | |||
classpath "com.dicedmelon.gradle:jacoco-android:0.1.5" | |||
classpath "io.freefair.gradle:android-gradle-plugins:4.2.0-m1" | |||
classpath "com.diffplug.spotless:spotless-plugin-gradle:5.16.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really need this here if it's already defined as plugin below?
|
||
task clean(type: Delete) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you removed the clean task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spotless which we are using for formatting is defining it.
diffplug/spotless#521
@@ -37,3 +68,13 @@ ext { | |||
minSdkVersion = 16 | |||
targetSdkVersion = 30 | |||
} | |||
|
|||
task createSpotlessPreCommitHook() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't compile on my end:
Cannot run program "bash": CreateProcess error=2 The system cannot find the file...
Cannot commit in Android Studio after this changes: Running spotless check > Task :spotlessJava > Task :spotlessJavaApply > Task :spotlessKotlin FAILED Step 'ktlint' found problem in 'ktx\src\main\java\com\parse\ktx\ParseQuery.kt': Error on line: 4, column: 1 Wildcard import java.lang.AssertionError: Error on line: 4, column: 1 Wildcard import at |
🎉 This pull request has been released in version 2.0.1 |
🎉 This pull request has been released in version 2.0.1 |
1 similar comment
🎉 This pull request has been released in version 2.0.1 |
New Pull Request Checklist
Issue Description
Related issue: #1119
Approach
Added Spotless formatter for most types of files in the project (eg. .java, .kt, .xml, .gradle).
Spotless is configured to use ktlint for Kotlin and Google Code Style AOSP for Java.
TODOs before merging
Add tests