From c3ec0ab8e116e54e4db2fb681fa5be2ce2e177a6 Mon Sep 17 00:00:00 2001 From: Jolanda Verhoef Date: Fri, 27 May 2022 14:14:47 +0200 Subject: [PATCH 1/2] Update pull_request_template.md (#65) * Update pull_request_template.md * Update .github/PULL_REQUEST_TEMPLATE/pull_request_template.md Co-authored-by: Alex Vanyo Co-authored-by: Alex Vanyo --- .github/PULL_REQUEST_TEMPLATE/pull_request_template.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 # 🦕 From e470b8e69a0613c2700b4ef324a0d23560d9e1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Fri, 27 May 2022 14:15:00 +0200 Subject: [PATCH 2/2] Make code style default for project (#67) * Remove code styles from gitignore Change-Id: I509dbebd597cb17901531c8df4fb26b723f588a0 * Import Nia code style Change-Id: If720554dd143d409f43b5d741a701beb9601d246 * Remove import mention from setup.sh Change-Id: I0fd180ff142cf9967ee6238bc42b063f277c2a74 --- .gitignore | 6 +- .idea/codeStyles/Project.xml | 332 +++++++++++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + tools/setup.sh | 7 +- 4 files changed, 343 insertions(+), 7 deletions(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml 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\