overcommit icon indicating copy to clipboard operation
overcommit copied to clipboard

JavaCheckStyle and Ktlint fail when overcommit is run

Open hkhan-iengineering opened this issue 4 years ago • 1 comments

I am getting the following error when running overcommit after signing it. Analyze with JavaCheckStyle..........................[JavaCheckstyle] FAILED 'checkstyle' is not installed, not in your PATH, or does not have execute permissions Analyze with KtLint..........................................[Ktlint] FAILED 'ktlint' is not installed, not in your PATH, or does not have execute permissions

Following is my yaml file configuration for both the hooks: PreCommit: JavaCheckstyle: enabled: true on_warn: fail # Treat all warnings as failures description: 'Analyze with JavaCheckStyle' required_executable: 'checkstyle' Ktlint: enabled: true on_warn: fail # Treat all warnings as failures description: 'Analyze with KtLint' required_executable: 'ktlint'

Any help on this?

hkhan-iengineering avatar Apr 27 '22 09:04 hkhan-iengineering

Resolved by installing the relevant hooks in the project directory by using

brew install checkstyle,
brew install ktlint

hkhan-iengineering avatar Apr 28 '22 07:04 hkhan-iengineering