tjni / captain-hook Goto Github PK
View Code? Open in Web Editor NEWGradle plugin for installing Git hooks.
License: MIT License
Gradle plugin for installing Git hooks.
License: MIT License
Thanks for captain-hook
- it's a nice tool that we're thinking of adding to an open source project.
One thing that I'm curious about is the automatic installation of hooks; in some ways this is nice, but I can foresee some people objecting to it.
I see autoApplyGitHooks = false
in the README, but I wonder if this could also be made opt-in via an interactive prompt. Is this a feature that you'd consider?
Release 0.1.5 was done but it is not in maven central yet. Can you make it available, please?
First off, excellent name. Best name I've seen for a plugin in a while, and I think names matter a lot, so you're off to a great start.
I might be misunderstanding it, but I understand this plugin to have two parts:
Part 1 just takes the "git hooks" idea, and lets you implement them entirely within the gradle script. Getting git hooks to run properly on a new machine can be pretty tedious, and gradle handles problems like this wonderfully, so I think moving git hooks into a gradle plugin is a fantastic idea. It is easy to understand conceptually what is happening, but pretty tricky to actually do it. I think that's the sweet spot for build plugins - hard enough that you want a plugin, but easy enough that you can tell what is happening.
Part 2 is the staging
task. I read the docs a couple times, and it seems like it has to be psychic or dig really deep into gradle's guts in order to understand what to "save". Also, if I already put some into the staging area, I'm a little worried about what might happen to it. Do I get an error, or does it just get clobbered? If something is hard to understand, it has to be really useful and really hard to build in order to justify getting through the docs. I might just be dumb, or maybe the docs just need a V2, but imo Part 2 is polluting Part 1.
I personally don't like the "staging area" concept, and I sorta wish git just did blob storage and nothing else - no scripts, line ending conversion, etc. So I'm not really your audience regardless, feel free to disregard. But I understand the value of git hooks, and I've worked with projects that use them extensively, and a plugin that does Part 1 is a no-brainer "let's use this". But Part 2 muddles things quite a bit, and would lead me to search for something simpler. Just my 2 cents, feel free to disregard, best of luck with your super-excellently-named project :)
Thank you for this plugin, in combination with spotless it works great!
It would be really amazing to see this plugin published to the plugins repository following the guide
https://plugins.gradle.org/docs/submit
That would greatly reduce the part
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.github.tjni.captainhook:captain-hook:0.1.4'
}
}
apply plugin: 'com.github.tjni.captainhook'
to just one line id 'com.github.tjni.captainhook'
as the recommended way of plugin definition by gradle
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.