git-hooks:一些有用的 ruby​​ git 钩子

时间:2021-06-03 20:12:25
【文件属性】:
文件名称:git-hooks:一些有用的 ruby​​ git 钩子
文件大小:26KB
文件格式:ZIP
更新时间:2021-06-03 20:12:25
Ruby GitHooks 这个 gem 提供了一个接口来在 Ruby 中编写有用的 git 钩子。 在任何编程语言的项目中工作时都可以使用这些钩子。 安装 将此行添加到您的应用程序的Gemfile : gem 'git-hooks' 然后执行: $ bundle 或者自己安装: $ gem install git-hooks 用法 在您的项目上安装 git_hooks。 $ cd /path/to/project $ git_hooks install pre-commit [--force] 创建配置文件 在项目根目录上创建一个.git_hooks.yml 。 $ cd /path/to/project $ git_hooks init 现在你会发现以下内置钩子: 防止在 master 分支上提交。 防止犯有 rubocop 罪行。 防止提交损坏的 rspec 测试。
【文件预览】:
git-hooks-master
----.gitignore(194B)
----CHANGELOG(525B)
----.rspec(41B)
----git-hooks.gemspec(1KB)
----bin()
--------git_hooks(82B)
----.travis.yml(94B)
----git_hooks.yml.example(221B)
----.rubocop.yml(287B)
----.git_hooks.yml(220B)
----spec()
--------git-hooks_spec.rb(3KB)
--------git_hooks()
--------spec_helper.rb(369B)
--------fixtures()
----README.md(3KB)
----.rubocop_todo.yml(478B)
----hook.sample(106B)
----lib()
--------git_hooks()
--------git-hooks.rb(2KB)
----Gemfile(99B)
----Rakefile(93B)

网友评论