kiwix-android icon indicating copy to clipboard operation
kiwix-android copied to clipboard

Improve speed of commit hook by removing lint

Open macgills opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe. Commits take too long leading contributors to default to the --no-verify option

Describe the solution you'd like Only keep detekt and ktlint in the hook which are relatively very quick steps that avoid full compilation

macgills avatar Nov 12 '20 11:11 macgills

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Jan 11 '21 11:01 stale[bot]

I wonder how uch these hooks are maintained and used currently!

kelson42 avatar Jan 26 '23 19:01 kelson42

@MohitMaliFtechiz Can you please update this issue? Does it still make sense?

kelson42 avatar Apr 04 '24 05:04 kelson42

@kelson42 The pre-commit takes 1 to 1.30 minute on the first commit When we initially commit something because it compiles with all the files in the project, and after that, it runs very fast because it only compiles with the affected files only. Also, we have two more things in our pre-commit script ktlint and detekt which check the code-styling, code formatting, etc. If we only remove the lint then it still takes 50-70 seconds on the first commit.

The current pre-commit hook is effective because it identifies potential errors in the code and alerts the developer to these errors during the commit process. This allows the developer to address the errors before finalizing their changes. Removing lint from our pre-commit would result in these errors being included in the commit and subsequently failing the CI process. In such cases, developers would need to rectify the errors and resubmit the code, This will waste the developer's time and CI resources as well(Since it only takes a few more seconds while committing the changes and we can avoid this type of situation).

An example of this type of situation https://github.com/kiwix/kiwix-android/pull/3777#discussion_r1552970758.

MohitMaliFtechiz avatar Apr 15 '24 13:04 MohitMaliFtechiz

OK, so lets keep like this then!

kelson42 avatar Apr 15 '24 19:04 kelson42