From f494d291b1c29f06945f7aa8cb06a83c029b49af 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] 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\