From 6c531066e75e026a77ded52ae85848f88a22d4c8 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 25 Sep 2020 10:23:32 -0300 Subject: [PATCH] Enable automatic coding style linting with ktlint (also on CI) This way the coding style is guaranteed to stay consistent. --- .editorconfig | 4 +++ .gitignore | 1 + .idea/codeStyles/Project.xml | 10 +++++++ .idea/inspectionProfiles/Project_Default.xml | 10 +++++++ .travis.yml | 2 +- app/build.gradle | 27 ++++++++++++++++--- .../java/com/stevesoltys/seedvault/App.kt | 2 +- .../seedvault/UsbIntentReceiver.kt | 4 ++- .../stevesoltys/seedvault/crypto/Crypto.kt | 15 ++++++----- .../stevesoltys/seedvault/header/Header.kt | 4 ++- .../seedvault/header/HeaderReader.kt | 12 ++++++--- .../seedvault/metadata/MetadataManager.kt | 3 ++- .../seedvault/metadata/MetadataReader.kt | 6 ++--- .../restore/RestoreErrorBroadcastReceiver.kt | 6 +++-- .../seedvault/restore/RestoreViewModel.kt | 13 ++++++--- .../seedvault/settings/SettingsFragment.kt | 4 +-- .../ConfigurableBackupTransportService.kt | 4 +-- .../seedvault/transport/backup/ApkBackup.kt | 4 +-- .../transport/backup/BackupCoordinator.kt | 18 ++++++++----- .../transport/restore/ApkInstaller.kt | 6 +++-- .../seedvault/transport/restore/ApkRestore.kt | 12 ++++----- .../ui/storage/StorageRootAdapter.kt | 1 - .../ui/storage/StorageRootFetcher.kt | 12 ++++++--- .../seedvault/crypto/KeyManagerTestImpl.kt | 2 +- .../seedvault/crypto/WordListTest.kt | 15 +++++++---- .../seedvault/metadata/MetadataReaderTest.kt | 4 ++- .../metadata/MetadataWriterDecoderTest.kt | 4 ++- .../transport/backup/ApkBackupTest.kt | 9 ++++--- .../transport/backup/BackupCoordinatorTest.kt | 19 +++++++++---- .../transport/restore/ApkRestoreTest.kt | 2 +- .../restore/RestoreCoordinatorTest.kt | 2 +- 31 files changed, 167 insertions(+), 70 deletions(-) create mode 100644 .editorconfig create mode 100644 .idea/inspectionProfiles/Project_Default.xml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..d2aef5ea --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +[*.{kt,kts}] +indent_size=4 +insert_final_newline=true +max_line_length=100 diff --git a/.gitignore b/.gitignore index 89216d50..ec605697 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ out/ lib/ .idea/* !.idea/runConfigurations* +!.idea/inspectionProfiles* !.idea/codeStyles* *.ipr *.iws diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index e122e4f9..35a40e4e 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -131,6 +131,16 @@