From a2a20fcc65a646905c25d94841c1d285e0a3f9a0 Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Sun, 14 Jun 2026 20:26:57 +0100 Subject: [PATCH] Add Kotlin code formatting/style configuration files --- .gitignore | 3 ++- src/android/.editorconfig | 16 ++++++++++++++++ src/android/.gitignore | 3 ++- .../.idea/inspectionProfiles/Project_Default.xml | 14 ++++++++++++++ tools/check-kotlin-formatting.sh | 1 + 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 src/android/.editorconfig create mode 100644 src/android/.idea/inspectionProfiles/Project_Default.xml create mode 100755 tools/check-kotlin-formatting.sh diff --git a/.gitignore b/.gitignore index b234d6bc5..1ad5f381a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,8 @@ src/common/scm_rev.cpp *.swp *.kdev4 .markdown-preview.html -.idea/ +.idea/* +!.idea/inspectionProfiles .vs/ .vscode/ .cache/ diff --git a/src/android/.editorconfig b/src/android/.editorconfig new file mode 100644 index 000000000..233c261c3 --- /dev/null +++ b/src/android/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*.{kt,kts}] +ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL +ktlint_code_style = android_studio + +# Disable wildcard imports +ij_kotlin_name_count_to_use_star_import = 2147483647 +ij_kotlin_name_count_to_use_star_import_for_members = 2147483647 +ij_kotlin_packages_to_use_import_on_demand = unset + +# Style configuration +indent_size = 4 +indent_style = space +ktlint_standard_package-name = disabled +max_line_length = 100 \ No newline at end of file diff --git a/src/android/.gitignore b/src/android/.gitignore index 40b6c5cd0..992701e0e 100644 --- a/src/android/.gitignore +++ b/src/android/.gitignore @@ -34,7 +34,8 @@ captures/ # IntelliJ *.iml -.idea/ +.idea/* +!.idea/inspectionProfiles # Keystore files # Uncomment the following line if you do not want to check your keystore files in. diff --git a/src/android/.idea/inspectionProfiles/Project_Default.xml b/src/android/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 000000000..2bf207346 --- /dev/null +++ b/src/android/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/tools/check-kotlin-formatting.sh b/tools/check-kotlin-formatting.sh new file mode 100755 index 000000000..666d97e4e --- /dev/null +++ b/tools/check-kotlin-formatting.sh @@ -0,0 +1 @@ +cd ./src/android/ && ktlint --color '!./app/build/generated/**'