ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

KtLint Auto-formatting #444

Open shubertm opened 1 week ago

shubertm commented 1 week ago

:rocket: Summary

Configure ktlint to use auto formatting after format violations checks Issue:

:framed_picture: Screenshots:

Provide screenshots to make it visible to reviewer if possible (Optional)

Before After
Screenshot_1 Screenshot_2
sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

hieuwu commented 1 week ago

Great work. Could you please also document how to use it?

shubertm commented 1 week ago

Great work. Could you please also document how to use it?

Alright, btw how are we keeping the documentation? I heard you documenting something too

kirillt commented 1 week ago

@shubertm I think @hieuwu means some instructions in README if anything needs to be run manually by a developer.

But my understanding is that Gradle will run ktlint automatically, right?

shubertm commented 6 days ago

@shubertm I think @hieuwu means some instructions in README if anything needs to be run manually by a developer.

But my understanding is that Gradle will run ktlint automatically, right?

Yes, it will fix all of our formatting style violations automatically, good for new developers not to worry about code formatting errors. We did this in Retouch too. And @kirillt I was thinking if we could have this in all Kotlin repos? @hieuwu I think there is nothing a dev is supposed to do manually.

shubertm commented 13 hours ago

Looks good. Later, do you think we can have a hook with the coding convention? Like before commit or push event, we will run check then notify in the terminal so that developer can fix their own before the code is pushed

Yeah, earlier we had that pre-commit scripts. I will see about it. It's really important because sometimes auto format misses some