Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up KtLint #71

Merged
merged 7 commits into from
Nov 5, 2024
Merged

Set up KtLint #71

merged 7 commits into from
Nov 5, 2024

Conversation

shubertm
Copy link
Member

@shubertm shubertm commented Aug 8, 2024

The aim of this PR is to enforce Kotlin code style across Memo developers using KtLint plugin.And this makes it easier for new developers too, they can concentrate on solving the actual problem instead of spending much time on formatting code. In most ARK Kotlin repos we are using https://github.com/JLLeitschuh/ktlint-gradle, here as well

@tuancoltech
Copy link
Collaborator

@shubertm Could you describe the changes in this PR please?

# Conflicts:
#	app/build.gradle
#	app/src/main/java/dev/arkbuilders/arkmemo/App.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/graphics/SVG.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/media/ArkAudioRecorderImpl.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/media/ArkMediaPlayer.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/media/ArkMediaPlayerImpl.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/models/GraphicNote.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/models/SaveNoteResult.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/models/TextNote.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/models/VoiceNote.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/preferences/MemoPreferences.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/preferences/MemoPreferencesImpl.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/repo/NotesRepoHelper.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/repo/graphics/GraphicNotesRepo.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/repo/text/TextNotesRepo.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/repo/voices/VoiceNotesRepo.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/activities/MainActivity.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/NotesListAdapter.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/dialogs/NoteDeleteDialog.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/ArkMediaPlayerFragment.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/ArkRecorderFragment.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/BaseEditNoteFragment.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/EditGraphicNotesFragment.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/EditTextNotesFragment.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/NotesFragment.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/fragments/SettingsFragment.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/viewmodels/ArkMediaPlayerViewModel.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/viewmodels/ArkRecorderViewModel.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/viewmodels/GraphicNotesViewModel.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/viewmodels/NotesViewModel.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/views/NotesCanvas.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/ui/views/WaveView.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/utils/Config.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/utils/NoteExt.kt
#	app/src/main/java/dev/arkbuilders/arkmemo/utils/Utils.kt
#	build.gradle
@shubertm shubertm merged commit 6a90eca into main Nov 5, 2024
4 checks passed
@@ -10,6 +10,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shubertm For which reason do we need this permission?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can check the lint error here https://github.com/ARK-Builders/ARK-Memo/actions/runs/11668539341/job/32488691548. Seems glide posts some notifications. Yet am not really sure

Comment on lines -13 to +14
Intent(Intent.ACTION_VIEW).setData(Uri.parse(url)))
Intent(Intent.ACTION_VIEW).setData(Uri.parse(url)),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shubertm I don't see the point of adding an extra comma to the end of this line, or in any other parameterized blocks.
Could you elaborate?

Copy link
Member Author

@shubertm shubertm Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to change the ktlint rules for trailing commas. Disallow them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants