style: code formatting and checks in the CI
### New Pull Request Checklist
<!--
    Please check the following boxes [x] before submitting your issue.
    Click the "Preview" tab for better readability.
    Thanks for contributing to Parse Server!
-->

- [x] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-SDK-Android/blob/master/SECURITY.md).
- [x] I am creating this PR in reference to an [issue](https://github.com/parse-community/Parse-SDK-Android/issues?q=is%3A1119).

### 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~~
- [x] Add changes to documentation (guides, repository pages, in-code descriptions)
- [x] A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

build.gradle
buildscript {
    ext.kotlin_version = "1.5.31"
    ext.jacocoVersion = '0.8.7'
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.2"
        classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.3"
        classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        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"
    }
}

plugins {
    id "com.github.ben-manes.versions" version "0.28.0"
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

ext {
    compileSdkVersion = 30

    minSdkVersion = 16
    targetSdkVersion = 30
}

buildscript {
    ext.kotlin_version = "1.5.31"
    ext.jacocoVersion = '0.8.7'
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.2"
        classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.3"
        classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        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"
    }
}

plugins {
    id "com.github.ben-manes.versions" version "0.28.0"
    id "com.diffplug.spotless" version "5.16.0"
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }

    apply plugin: "com.diffplug.spotless"

    spotless {
        java {
            target '**/*.java'
            googleJavaFormat().aosp()
            removeUnusedImports()
            trimTrailingWhitespace()
            indentWithSpaces()
            endWithNewline()
        }
        kotlin {
            target '**/*.kt'
            ktlint("0.42.1")
            trimTrailingWhitespace()
            indentWithSpaces()
            endWithNewline()
        }
        format 'misc', {
            target '**/*.gradle', '**/*.md', '**/.gitignore'
            indentWithSpaces()
            trimTrailingWhitespace()
            endWithNewline()
        }

        format 'xml', {
            target '**/*.xml'
            indentWithSpaces()
            trimTrailingWhitespace()
            endWithNewline()
        }
    }
}

ext {
    compileSdkVersion = 30

    minSdkVersion = 16
    targetSdkVersion = 30
}

task createSpotlessPreCommitHook() {
    def gitHooksDirectory = new File("$project.rootDir/.git/hooks/")
    if (!gitHooksDirectory.exists()) gitHooksDirectory.mkdirs()
    new File("$project.rootDir/.git/hooks", "pre-commit").text = """#!/bin/bash
    echo "Running spotless check"
    ./gradlew spotlessApply
"""
    "bash chmod +x .git/hooks/pre-commit".execute()
}

This doesn't compile on my end:

Cannot run program "bash": CreateProcess error=2 The system cannot find the file...