Class GitPrePushHookInstallerGradle

java.lang.Object
com.diffplug.spotless.GitPrePushHookInstaller
com.diffplug.spotless.GitPrePushHookInstallerGradle

public class GitPrePushHookInstallerGradle extends GitPrePushHookInstaller
Implementation of GitPrePushHookInstaller specifically for Gradle-based projects. This class installs a Git pre-push hook that uses Gradle's `gradlew` executable to check and apply Spotless formatting.
  • Constructor Details

  • Method Details

    • preHookContent

      protected String preHookContent()
      Provides the content of the hook that should be inserted into the pre-push script.
      Specified by:
      preHookContent in class GitPrePushHookInstaller
      Returns:
      A string representing the content to include in the pre-push script.