poper 0.0.1 → 0.0.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 +1 -0
- data/lib/poper/rule/generic.rb +14 -0
- data/lib/poper/runner.rb +2 -1
- data/lib/poper/version.rb +1 -1
- data/lib/poper.rb +1 -1
- metadata +3 -3
- data/lib/poper/rule/banned.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9abd695f0fb3e1824c45c4979a2a9d3d72021e9
|
4
|
+
data.tar.gz: 6e2891f64e04be17af1e4ed5eb1a1ec53dbefb49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29155d2fb248dc20e7f907aeb9586699d1c1486fc6043f690e0bde1e98493cc0be5565d5a2cb9f99be1406a54fd5f323a53a6aeeecc57256546153a5491cd477
|
7
|
+
data.tar.gz: 0307cd1f8cc2c319d83704aba0ffdbc4eab30db81d251fccd4bed29da5f643925c8abb44b75eac5082382bab38489b6d66b5fd9929a7729b17414046b46c315b
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@ Poper makes sure that your git commit messages are well-formed
|
|
4
4
|
|
5
5
|
[![Code Climate](https://codeclimate.com/github/mmozuras/poper.png)](https://codeclimate.com/github/mmozuras/poper)
|
6
6
|
[![Build Status](https://travis-ci.org/mmozuras/poper.png)](https://travis-ci.org/mmozuras/poper)
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/poper.png)](http://badge.fury.io/rb/poper)
|
7
8
|
[![Dependency Status](https://gemnasium.com/mmozuras/poper.png)](https://gemnasium.com/mmozuras/poper)
|
8
9
|
|
9
10
|
## Usage
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Poper
|
2
|
+
module Rule
|
3
|
+
class Generic < Rule
|
4
|
+
MSG = 'Consider writing a more detailed, not as generic, commit summary'
|
5
|
+
GENERIC = %w(fix fixed fixes oops todo fixme commit changes hm hmm hmmm
|
6
|
+
test tests quickfix)
|
7
|
+
|
8
|
+
def check(message)
|
9
|
+
words = message.scan(/[\w-]+/).compact
|
10
|
+
MSG if words.all? { |word| GENERIC.include?(word.downcase) }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/poper/runner.rb
CHANGED
@@ -4,7 +4,8 @@ module Poper
|
|
4
4
|
class Runner
|
5
5
|
def initialize(commit, repo_path = '.')
|
6
6
|
@repo = Rugged::Repository.new(repo_path)
|
7
|
-
|
7
|
+
merge_base = @repo.merge_base(commit, commit) # hack to make refs work
|
8
|
+
@commit = @repo.lookup(merge_base)
|
8
9
|
end
|
9
10
|
|
10
11
|
def run
|
data/lib/poper/version.rb
CHANGED
data/lib/poper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindaugas Mozūras
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|
@@ -74,9 +74,9 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- lib/poper/cli.rb
|
77
|
-
- lib/poper/rule/banned.rb
|
78
77
|
- lib/poper/rule/capitalization.rb
|
79
78
|
- lib/poper/rule/fifty_char_summary.rb
|
79
|
+
- lib/poper/rule/generic.rb
|
80
80
|
- lib/poper/rule/rule.rb
|
81
81
|
- lib/poper/rule/seventy_two_char_limit.rb
|
82
82
|
- lib/poper/rule/single_word.rb
|
data/lib/poper/rule/banned.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
module Poper
|
2
|
-
module Rule
|
3
|
-
class Banned < Rule
|
4
|
-
MSG = 'Consider writing a more detailed commit summary'
|
5
|
-
BANNED = %w(fix fixed oops todo fixme commit changes hmm hmmm quickfix)
|
6
|
-
|
7
|
-
def check(message)
|
8
|
-
MSG if BANNED.include?(message.lines.first.strip.downcase)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|