scribe-org / Scribe-Android

Android app with keyboards for language learners
GNU General Public License v3.0
41 stars 40 forks source link

Add pre-commit hooks to Scribe-Android #215

Closed andrewtavis closed 1 month ago

andrewtavis commented 1 month ago

Terms

Description

This issue would focus on adding in pre-commit to Scribe-Android such that linting, formatting and other checks could be ran on commit to avoid them being sent to the repo. Directions on how to setup pre-commit would further need to be added to the readme and contributing guide :)

The pre-commit config for this issue can generally be that of Scribe-Data, which can be found here.

Contribution

Would be happy to support or get to this as I can! This would also be a good first issue for someone who has some Python experience or experience setting up pre-commit 😊

KesharwaniArpita commented 1 month ago

Hi @andrewtavis Can I work on this ?

andrewtavis commented 1 month ago

Yes by all means, @KesharwaniArpita :) Please transfer the pre-commit confirmation file from Scribe-Data, and also try to add the documentation that Scribe-Data has for pre-commit to the readme and contributing files over here. I'll clean up the documentation as needed.

MostafaMohamed2002 commented 1 month ago

i was about to suggest that 😂

andrewtavis commented 1 month ago

Assigning you both as maybe @MostafaMohamed2002 can support if @KesharwaniArpita has any questions :)

KesharwaniArpita commented 1 month ago

Hi @andrewtavis and @MostafaMohamed2002, I have a question about the adding pre-commits, as Scribe Android mainly uses Java/Kotlin, so wee need to add more relevant linters and formatters, such as ktlint and detekt to the pre-commits? I have already raised the pr to add the file and documentation. Will we need the mentioned linters too?

MostafaMohamed2002 commented 1 month ago

Hi @andrewtavis and @MostafaMohamed2002, I have a question about the adding pre-commits, as Scribe Android mainly uses Java/Kotlin, so wee need to add more relevant linters and formatters, such as ktlint and detekt to the pre-commits? I have already raised the pr to add the file and documentation. Will we need the mentioned linters too?

Hi @KesharwaniArpita, we already use ktlint and detekt as you see here https://github.com/scribe-org/Scribe-Android/blob/70185902521d79f2a2ab319ec9b38b2849f22b0d/.github/workflows/pr_ktlint_detekt.yaml#L1-L31

so instead of run them when open a pr we need you to make pre-commit hook to run detekt and ktlint before any commit .

MostafaMohamed2002 commented 1 month ago

I recommend you read this article it will definitely help you 😉

KesharwaniArpita commented 1 month ago

Thank you @MostafaMohamed2002

andrewtavis commented 1 month ago

Closed by #219 😊 Thanks so much for the support here, @MostafaMohamed2002! And thanks for the setup and documentation, @KesharwaniArpita :)