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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c77c51765ec627e156a600d56c8b1482177a5c5c
4
- data.tar.gz: caa7c6910ee5dace99a7f0e803c8e06695a7f91b
3
+ metadata.gz: d21bb9cb6c25372a6a849a323d359560e7124d6e
4
+ data.tar.gz: e12f6bbacefa30b78bdb4164b887f9b0dd984402
5
5
  SHA512:
6
- metadata.gz: 1a2d08fbaf7df3343c3cec005bd5bde68d3837775c3c3659e7aea47aca5f48315abfc45c9e237f609016d6f876196bc640f417717b3b2a0df82c90ddf208ab90
7
- data.tar.gz: 76b7092a38bed2ca405ffc9bf000a004689939b6aa9caa6c370a313747c6f5aae965683d4afd8d93e417cfe8d14cbec5168f01483e47a3a865bc5a6f048fa029
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)
@@ -1,3 +1,3 @@
1
1
  module FitCommit
2
- VERSION = "2.2.1"
2
+ VERSION = "2.2.2"
3
3
  end
@@ -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 name-rev --name-only HEAD`
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
@@ -3,6 +3,6 @@ require "yaml"
3
3
 
4
4
  def default_config_for(key)
5
5
  YAML.load_file(
6
- File.expand_path("../../../templates/config/fit_commit.default.yml", __FILE__)).
6
+ File.expand_path("../../../../templates/config/fit_commit.default.yml", __FILE__)).
7
7
  fetch(key)
8
8
  end
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.1
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-10 00:00:00.000000000 Z
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/configuration_loader_test.rb
93
- - test/message_parser_test.rb
94
- - test/runner_test.rb
95
- - test/validator_loader_test.rb
96
- - test/validators/frathouse_test.rb
97
- - test/validators/line_length_test.rb
98
- - test/validators/summary_period_test.rb
99
- - test/validators/tense_test.rb
100
- - test/validators/validator_helper.rb
101
- - test/validators/wip_test.rb
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/configuration_loader_test.rb
136
- - test/message_parser_test.rb
137
- - test/runner_test.rb
138
- - test/validator_loader_test.rb
139
- - test/validators/frathouse_test.rb
140
- - test/validators/line_length_test.rb
141
- - test/validators/summary_period_test.rb
142
- - test/validators/tense_test.rb
143
- - test/validators/validator_helper.rb
144
- - test/validators/wip_test.rb
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: