lib/git/lint/analyzers/commit_subject_prefix.rb in git-lint-3.3.0 vs lib/git/lint/analyzers/commit_subject_prefix.rb in git-lint-3.3.1
- old
+ new
@@ -4,11 +4,11 @@
module Lint
module Analyzers
# Analyzes commit subject uses standard prefix.
class CommitSubjectPrefix < Abstract
def valid?
- return true if commit.prefix?
+ return true if locally_prefixed?
return true if filter_list.empty?
commit.subject.match?(/\A#{Regexp.union filter_list.to_regexp}/)
end
@@ -19,9 +19,13 @@
end
protected
def load_filter_list = Kit::FilterList.new(settings.includes)
+
+ def locally_prefixed? = !ci? && commit.prefix?
+
+ def ci? = container[:environment]["CI"] == "true"
end
end
end
end