question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add task to install git pre-commit-hook

See original GitHub issue

Ktlint supports installing git pre-commit hook, that will check style violations on git commit. Would be nice to add this as a Gradle task to simplify setup for the project.

Name should be: ktlintAddGitPreCommitHook

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:30 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
Tapchicomacommented, Apr 9, 2019

Initial implementation was merged (should be in next 7.3.0 release). Missing:

  • buildSrc support
  • composite builds support
3reactions
Tapchicomacommented, Jun 11, 2018

That are good questions 👍

Regarding them I am thinking of adding two possible git hooks:

  • runs Gradle task ktlintCheck before commit
  • runs Gradle task ktlintFormat before commit

This way git hook will be not detached from plugin and plugin configuration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git Hooks - Git SCM
The pre-commit hook is run first, before you even type in a commit message. It's used to inspect the snapshot that's about to...
Read more >
Git pre-hook: Setup pre-commit hook for Gradle project example
1. Create a pre-hook script, let's create pre-commit file inside a new scripts directory, and we want to run unit tests before code...
Read more >
How to Add Commit Hooks to Git with Husky to Automate ...
How to Add Commit Hooks to Git with Husky to Automate Code Tasks · Step 0: How to set up a new project...
Read more >
Git Hooks | Atlassian Git Tutorial
applypatch-msg.sample pre-push.sample commit-msg.sample pre-rebase.sample ... To install the hook, you can either create a symlink to it in .git/hooks ...
Read more >
Git Hooks | Learn how to use pre-commit hooks, post-commit ...
Git hooks are scripts that Git executes before or after events such as: commit, push, and receive. Git hooks are a built-in feature...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found