gradle-pre-commit-git-hooks icon indicating copy to clipboard operation
gradle-pre-commit-git-hooks copied to clipboard

feat: allow to instantiate extension w/o settings

Open googol42 opened this issue 10 months ago • 0 comments

allowing to pass the path to the extension enable usage even after the settings have been evaluated

Changes

I added another constructor to allow using the GitHooksExtension without Settings object.

Context

My problem is that I cannot use your plugin withing the settings.gradle.kts. My setup is complex and I basically can only have plugins in my build.gradle.kts. With this change I am able to figure out the path myself and create my instance of the GitHooksExtension myself and pass the path.

That means: When it is not absolutely required that the plugin is applied to the settings.gradle.kts this would even be preferable.

Documentation (please check one with an [x])

  • [ ] I have updated the README.md file, or
  • [x] No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • [x] Code inspection only, or
  • [ ] No unit tests but ran on a real Gradle project, or
  • [ ] Newly added/modified unit tests

googol42 avatar Feb 12 '25 17:02 googol42