Class: Peppermint::GwenGPT

Inherits:
Object
  • Object
show all
Defined in:
lib/peppermint/rake/gwenGPT.rb

Class Method Summary collapse

Class Method Details

.lint(subj, body) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/peppermint/rake/gwenGPT.rb', line 3

def self.lint(subj, body)
  if subj.match?(/[[:punct:]]$/)
    [false, "cannot end with punctuation"]
  elsif subj.match?(/^[a-z]/)
    [false, "cannot start with lowercase letter"]
  elsif subj.length > 120
    [false, "subject too long"]
  elsif subj.match?(/^[[:digit:]]*$/)
    [false, "no fastgit"]
  elsif body.count("\n") > 4
    [false, "large body"]
  else
    [true, "fine"]
  end
end