Pre-commit hook example that uses detekt to reveal code smells and aims to improve your code readability.
- Install detekt CLI. You can check installation by printing in terminal `detekt --version'.
- [Optional] Put your custom detekt rules to
${prjectDir}/config/detekt/config.yml
file. - Put file pre-commit in your
${projectDir}/.git/hooks
directory - Mark pre-commit file as executable:
chmod +x ${projectDir}/.git/hooks/pre-commit