ament_lint_cmake doesn't display reasons for error when run through pre-commit hook. It just displays exit code of 1 like:
ament_lint_cmake.........................................................Failed
- hook id: ament_lint_cmake
- exit code: 1
However if I run ament_lint_cmake manually, it displays the actual errors.