diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index ab8c4d0af..da9b19682 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -3,9 +3,14 @@ name: Pull request about: Create a pull request label: 'triage me' --- -Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +Thank you for opening a Pull Request! +Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea -- [ ] Ensure the tests and linter pass +- [ ] Ensure the tests and linter pass (`./gradlew spotlessApply` to automatically apply formatting) - [ ] Appropriate docs were updated (if necessary) +Is this your first Pull Request? +- [ ] Run `./tools/setup.sh` +- [ ] Import the code formatting style as explained in [the setup script](/tools/setup.sh#L40). + Fixes # 🦕 diff --git a/.gitignore b/.gitignore index ed6a9781b..d4482596d 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,11 @@ local.properties *.iml .idea/* !.idea/copyright -!.idea/codeStyles/codeStyleConfig.xml +# Keep the code styles. +!/.idea/codeStyles +/.idea/codeStyles/* +!/.idea/codeStyles/Project.xml +!/.idea/codeStyles/codeStyleConfig.xml # Gradle cache .gradle diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 000000000..a24d14540 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 000000000..79ee123c2 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/tools/setup.sh b/tools/setup.sh index 14edf5bb3..2e062838a 100755 --- a/tools/setup.sh +++ b/tools/setup.sh @@ -37,12 +37,7 @@ cp "${GIT_ROOT}/tools/pre-push" "${GIT_DIR}/hooks/pre-push" \ && chmod +x "${GIT_DIR}/hooks/pre-push" cat <<-EOF -Please import the code style settings in Android Studio: - * open Settings -> Editor -> Code Style - * click the gear icon and select "Import Scheme..." - * find the file ${GIT_ROOT}/tools/nowinandroid-codestyle.xml - -Additionally, checking the following settings helps avoid miscellaneous issues: +Checking the following settings helps avoid miscellaneous issues: * Settings -> Editor -> General -> Remove trailing spaces on: Modified lines * Settings -> Editor -> General -> Ensure every file ends with a line break * Settings -> Editor -> General -> Auto Import -> Optimize imports on the fly (for both Kotlin\