fit-commit 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/lib/fit_commit/version.rb +1 -1
- data/templates/hooks/commit-msg +1 -1
- data/test/integration/new_repo_test.rb +22 -0
- data/test/{configuration_loader_test.rb → unit/configuration_loader_test.rb} +0 -0
- data/test/{message_parser_test.rb → unit/message_parser_test.rb} +0 -0
- data/test/{runner_test.rb → unit/runner_test.rb} +0 -0
- data/test/{validator_loader_test.rb → unit/validator_loader_test.rb} +0 -0
- data/test/{validators → unit/validators}/frathouse_test.rb +0 -0
- data/test/{validators → unit/validators}/line_length_test.rb +0 -0
- data/test/{validators → unit/validators}/summary_period_test.rb +0 -0
- data/test/{validators → unit/validators}/tense_test.rb +0 -0
- data/test/{validators → unit/validators}/validator_helper.rb +1 -1
- data/test/{validators → unit/validators}/wip_test.rb +0 -0
- metadata +24 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d21bb9cb6c25372a6a849a323d359560e7124d6e
|
4
|
+
data.tar.gz: e12f6bbacefa30b78bdb4164b887f9b0dd984402
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fb51830aeae8aef4eb048de4267777fd2652c4c0a1bf6325cbe2104e636fd08a9927c40f03aa0f827af295a7a695994ba95f1071afc34b9c69f396aeb736d0d
|
7
|
+
data.tar.gz: 7e83385db30baf7bafb7606fe0bd1c358955baacc19f7486ccd1ffb347caf034064c5c3b9d0315577f3b165fb66b44f95e8cc4b143f0300a2a1a511ebbea5830
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ Force commit? [y/n] ▊
|
|
19
19
|
|
20
20
|
## Prerequisites
|
21
21
|
|
22
|
-
* Ruby >= 1.9
|
22
|
+
* Ruby >= 1.9 (OS X users already have this installed)
|
23
23
|
|
24
24
|
## Installation
|
25
25
|
|
@@ -102,6 +102,14 @@ To copy your default hooks into existing repos:
|
|
102
102
|
$ git init
|
103
103
|
```
|
104
104
|
|
105
|
+
### Who decided these rules?
|
106
|
+
Fit Commit aims to enforce *community standards*. The two influential guides on the subject are:
|
107
|
+
|
108
|
+
- [Tim Pope's blog](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
109
|
+
- [The official Git documentation](http://git.kernel.org/cgit/git/git.git/tree/Documentation/SubmittingPatches?id=HEAD)
|
110
|
+
|
111
|
+
The Git community has largely (but not completely) coalesced around these standards. [Chris Beams](http://chris.beams.io/posts/git-commit/) and the [Pro Git book](https://git-scm.com/book) also provide good summaries on why we have them.
|
112
|
+
|
105
113
|
### Fit Commit is too opinionated for me. What can I do?
|
106
114
|
Fit Commit aims to be useful to everyone. If you can suggest an improvement to make it useful to more people, please open a GitHub Issue or Pull Request.
|
107
115
|
|
@@ -111,3 +119,5 @@ Fit Commit aims to be useful to everyone. If you can suggest an improvement to m
|
|
111
119
|
Author: [Mike Foley](https://github.com/m1foley)
|
112
120
|
|
113
121
|
Inspiration taken from: [Tim Pope](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), [Jason Fox](https://gist.github.com/jasonrobertfox/8057124), [Addam Hardy](http://addamhardy.com/blog/2013/06/05/good-commit-messages-and-enforcing-them-with-git-hooks/), [pre-commit](https://github.com/jish/pre-commit)
|
122
|
+
|
123
|
+
Similar projects: [gitlint](https://github.com/jorisroovers/gitlint) (written in Python)
|
data/lib/fit_commit/version.rb
CHANGED
data/templates/hooks/commit-msg
CHANGED
@@ -27,7 +27,7 @@ if [ ! -r "$COMMIT_MESSAGE_PATH" ]; then
|
|
27
27
|
exit 0
|
28
28
|
fi
|
29
29
|
|
30
|
-
export GIT_BRANCH_NAME=`git
|
30
|
+
export GIT_BRANCH_NAME=`git symbolic-ref --short HEAD`
|
31
31
|
if [ -z "$GIT_BRANCH_NAME" ]; then
|
32
32
|
>&2 echo "fit-commit: WARNING: Skipping checks because the Git branch cannot be determined."
|
33
33
|
>&2 echo "fit-commit: Please submit a bug report with the project:"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "pty"
|
3
|
+
require "expect"
|
4
|
+
|
5
|
+
describe "Install and run in a fresh Git repo" do
|
6
|
+
BINARY_PATH = File.expand_path("../../../bin/fit-commit", __FILE__)
|
7
|
+
|
8
|
+
it "installs with no errors" do
|
9
|
+
Dir.mktmpdir do |gitdir|
|
10
|
+
results = ""
|
11
|
+
commands = "cd #{gitdir} && git init && #{BINARY_PATH} install && git commit --allow-empty -m fixing"
|
12
|
+
PTY.spawn(commands) do |pty_out, _pty_in, _pty_pid|
|
13
|
+
pty_out.expect(/Force commit\?/, 3) do |expect_out|
|
14
|
+
results << Array(expect_out).join
|
15
|
+
"n"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
assert_match(/^fixing/, results)
|
19
|
+
assert_match(/^1: Error: Message must use imperative present tense/, results)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fit-commit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Foley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: swearjar
|
@@ -89,16 +89,17 @@ files:
|
|
89
89
|
- lib/fit_commit/version.rb
|
90
90
|
- templates/config/fit_commit.default.yml
|
91
91
|
- templates/hooks/commit-msg
|
92
|
-
- test/
|
93
|
-
- test/
|
94
|
-
- test/
|
95
|
-
- test/
|
96
|
-
- test/
|
97
|
-
- test/validators/
|
98
|
-
- test/validators/
|
99
|
-
- test/validators/
|
100
|
-
- test/validators/
|
101
|
-
- test/validators/
|
92
|
+
- test/integration/new_repo_test.rb
|
93
|
+
- test/unit/configuration_loader_test.rb
|
94
|
+
- test/unit/message_parser_test.rb
|
95
|
+
- test/unit/runner_test.rb
|
96
|
+
- test/unit/validator_loader_test.rb
|
97
|
+
- test/unit/validators/frathouse_test.rb
|
98
|
+
- test/unit/validators/line_length_test.rb
|
99
|
+
- test/unit/validators/summary_period_test.rb
|
100
|
+
- test/unit/validators/tense_test.rb
|
101
|
+
- test/unit/validators/validator_helper.rb
|
102
|
+
- test/unit/validators/wip_test.rb
|
102
103
|
homepage: https://github.com/m1foley/fit-commit
|
103
104
|
licenses:
|
104
105
|
- MIT
|
@@ -132,14 +133,15 @@ signing_key:
|
|
132
133
|
specification_version: 4
|
133
134
|
summary: A Git hook to validate your commit messages
|
134
135
|
test_files:
|
135
|
-
- test/
|
136
|
-
- test/
|
137
|
-
- test/
|
138
|
-
- test/
|
139
|
-
- test/
|
140
|
-
- test/validators/
|
141
|
-
- test/validators/
|
142
|
-
- test/validators/
|
143
|
-
- test/validators/
|
144
|
-
- test/validators/
|
136
|
+
- test/integration/new_repo_test.rb
|
137
|
+
- test/unit/configuration_loader_test.rb
|
138
|
+
- test/unit/message_parser_test.rb
|
139
|
+
- test/unit/runner_test.rb
|
140
|
+
- test/unit/validator_loader_test.rb
|
141
|
+
- test/unit/validators/frathouse_test.rb
|
142
|
+
- test/unit/validators/line_length_test.rb
|
143
|
+
- test/unit/validators/summary_period_test.rb
|
144
|
+
- test/unit/validators/tense_test.rb
|
145
|
+
- test/unit/validators/validator_helper.rb
|
146
|
+
- test/unit/validators/wip_test.rb
|
145
147
|
has_rdoc:
|