rails_git_hooks 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +10 -3
- data/lib/rails_git_hooks/installer.rb +4 -1
- data/lib/rails_git_hooks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '039dc0fb243e8ce670d6cadeb3c3e398cc6441276953c9a0c1e8f8541864256e'
|
|
4
|
+
data.tar.gz: 26a46c6776054ec41554c60ad4ea06f48c14f703cd9c396735f2888b6b0f329b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 589952d05b4bbc277efc18f59a02bdd51ba2edeae20b26fb1b093186bdd57413a4949e25987b291b546b06f29b2c81cff394901cd6c6dd9527a1fd1c0f3f0101
|
|
7
|
+
data.tar.gz: d79a92159cd66cf640b1fc80a29ade822fd6e3215be50915aec2609301f7edd71a13b1b83252e4b94adbb95feed759f1dfb78eb80e1f23abd800419992a6a24f
|
data/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
6
|
|
|
7
|
-
## [0.6.
|
|
7
|
+
## [0.6.1] (latest)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Default install** now installs **commit-msg** and **pre-commit** only (Jira ticket prefix + default-branch protection + RuboCop). Pre-push remains opt-in: `rails_git_hooks install pre-push`.
|
|
12
|
+
- README: quick start and commands table updated for default (commit-msg + pre-commit); Jira project key / `JIRA_PROJECT_KEY` for manual install; pre-push install instruction.
|
|
13
|
+
|
|
14
|
+
## [0.6.0]
|
|
8
15
|
|
|
9
16
|
### Added
|
|
10
17
|
|
data/README.md
CHANGED
|
@@ -41,7 +41,11 @@ bundle install
|
|
|
41
41
|
bundle exec rails_git_hooks install
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
**
|
|
44
|
+
This installs **commit-msg** (Jira ticket prefix) and **pre-commit** (blocks commits on `master`/`main` + RuboCop on staged `.rb` files) by default.
|
|
45
|
+
|
|
46
|
+
**2. Set your Jira project key**
|
|
47
|
+
|
|
48
|
+
Replace the default by passing your project key at install time or via env:
|
|
45
49
|
|
|
46
50
|
```bash
|
|
47
51
|
rails_git_hooks install --jira MYPROJ
|
|
@@ -50,7 +54,10 @@ export GIT_HOOKS_JIRA_PROJECT=MYPROJ
|
|
|
50
54
|
rails_git_hooks install
|
|
51
55
|
```
|
|
52
56
|
|
|
53
|
-
Default is `APD` if not set.
|
|
57
|
+
Default is `APD` if not set. For manual install: replace `JIRA_PROJECT_KEY` in the commit-msg script with your key (e.g. `APD`).
|
|
58
|
+
|
|
59
|
+
To also run the full test suite before push:
|
|
60
|
+
`rails_git_hooks install pre-push`
|
|
54
61
|
|
|
55
62
|
> **Tip:** If the pre-commit hook doesn’t run, make it executable: `chmod +x .git/hooks/pre-commit`
|
|
56
63
|
|
|
@@ -62,7 +69,7 @@ Run from your project root (inside a git repo).
|
|
|
62
69
|
|
|
63
70
|
| Command | Description |
|
|
64
71
|
|---------|-------------|
|
|
65
|
-
| `rails_git_hooks install [HOOK...] [--jira PROJECT]` | Install hooks. No args = install
|
|
72
|
+
| `rails_git_hooks install [HOOK...] [--jira PROJECT]` | Install hooks. No args = install default (commit-msg + pre-commit). |
|
|
66
73
|
| `rails_git_hooks list` | List available hook names. |
|
|
67
74
|
| `rails_git_hooks disable HOOK [HOOK...] [whitespace-check]` | Disable hooks (use `*` for all) or the whitespace-check. |
|
|
68
75
|
| `rails_git_hooks enable HOOK [HOOK...] [whitespace-check]` | Re-enable hooks or enable whitespace-check. |
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module GitHooks
|
|
4
4
|
class Installer
|
|
5
5
|
HOOKS_DIR = File.expand_path('templates', __dir__).freeze
|
|
6
|
+
# Default: Jira commit-msg + pre-commit (default-branch protection + RuboCop).
|
|
7
|
+
# Use install(*available_hooks) or pass names for more.
|
|
8
|
+
DEFAULT_HOOKS = %w[commit-msg pre-commit].freeze
|
|
6
9
|
|
|
7
10
|
def initialize(git_dir: nil, jira_project: nil)
|
|
8
11
|
@git_dir = git_dir || find_git_dir
|
|
@@ -13,7 +16,7 @@ module GitHooks
|
|
|
13
16
|
target_dir = File.join(@git_dir, 'hooks')
|
|
14
17
|
raise GitHooks::Error, "Not a git repository or .git/hooks not found: #{@git_dir}" unless Dir.exist?(target_dir)
|
|
15
18
|
|
|
16
|
-
hooks = hook_names.empty? ?
|
|
19
|
+
hooks = hook_names.empty? ? DEFAULT_HOOKS : hook_names
|
|
17
20
|
installed = []
|
|
18
21
|
|
|
19
22
|
hooks.each do |name|
|