modern-java-practices icon indicating copy to clipboard operation
modern-java-practices copied to clipboard

Discuss use of git hooks

Open binkley opened this issue 1 year ago • 1 comments

Is this related to #549 in context of a "dev init"?

Do not let quality checks be a speed barrier for red-green-refactor. Make them a barrier to pushing problems to others. Discuss breaking up the build to hasten cycle time.

  1. Diagram for steps in a build, local and CI.
  2. Leverage git hooks (local or in CI) to stop problems from spreading.
  3. Find usable red-green-refactor cycle image for this section.
  4. Include discussion of Gradle and Maven plugins to auto-create hooks for you.

Update this page: https://github.com/binkley/modern-java-practices/wiki/Cycle-time and integrate with other pages. Is this a good place for this reference? http://www.extremeprogramming.org/ <-- May be better in introduction? In a "Why this book" section?

ref:

  • https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
  • [GitLab] https://docs.gitlab.com/ee/administration/server_hooks.html

binkley avatar Apr 15 '24 15:04 binkley

@jwlibby Talk about what moves to CI.

The book should offer options and let the team pick. Discuss tradeoffs on speed for red-green-refactor vs local quality. Key is that all these issues are fixed before push to share with others.

Examples:

  • Checkstyle on pre-push, not on commit
  • Mutation testing (PIT) on pre-push, not on commit
  • How to automatically fix style issues in Java? (Kotlin ktlint does this)
  • Call out IDE settings

binkley avatar May 21 '24 14:05 binkley