parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 739 forks source link

style: code formatting and checks in the CI #1120

Closed azlekov closed 2 years ago

azlekov commented 2 years ago

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

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this pull request!

codecov[bot] commented 2 years ago

Codecov Report

Merging #1120 (7d10d58) into master (dd9a9e6) will increase coverage by 0.21%. The diff coverage is 65.51%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
.../src/main/java/com/parse/CacheQueryController.java 5.76% <0.00%> (-1.05%) :arrow_down:
...c/main/java/com/parse/KnownParseObjectDecoder.java 50.00% <ø> (ø)
parse/src/main/java/com/parse/Lists.java 90.00% <ø> (ø)
parse/src/main/java/com/parse/LocalIdManager.java 68.00% <0.00%> (ø)
...arse/src/main/java/com/parse/LocationNotifier.java 0.00% <0.00%> (ø)
parse/src/main/java/com/parse/LockSet.java 0.00% <0.00%> (ø)
...arse/src/main/java/com/parse/NoObjectsEncoder.java 75.00% <ø> (ø)
parse/src/main/java/com/parse/Numbers.java 19.51% <ø> (ø)
...rc/main/java/com/parse/OfflineQueryController.java 100.00% <ø> (ø)
parse/src/main/java/com/parse/PLog.java 76.66% <ø> (ø)
... and 148 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dd9a9e6...7d10d58. Read the comment docs.

azlekov commented 2 years ago

@mtrezza this is now done. Pipeline will fail if the source code is not formatting well. I have update the CONTRIBUTING.md so newcomers are guided what to run to eliminate ping-pong. All the source code is formatted to Google AOSP style guide for Java and ktlint for Kotlin.

azlekov commented 2 years ago

@mtrezza whenever your okay and ready feel free to merge.

mobilekosmos commented 2 years ago

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

parseplatformorg commented 2 years ago

🎉 This pull request has been released in version 2.0.1

parseplatformorg commented 2 years ago

🎉 This pull request has been released in version 2.0.1

parseplatformorg commented 2 years ago

🎉 This pull request has been released in version 2.0.1