lib/git/lint/container.rb in git-lint-6.2.1 vs lib/git/lint/container.rb in git-lint-7.0.0

- old
+ new

@@ -13,29 +13,51 @@ # Provides a global gem container for injection into other objects. module Container extend Dry::Container::Mixin namespace :trailers do - register(:collaborator, memoize: true) { /\ACo.*Authored.*By.*\Z/i } - register(:format, memoize: true) { /\AFormat.*\Z/i } - register(:issue, memoize: true) { /\AIssue.*\Z/i } - register(:signer, memoize: true) { /\ASigned.*By.*\Z/i } - register(:tracker, memoize: true) { /\ATracker.*\Z/i } + register :collaborator, memoize: true do + Configuration::Trailer[name: "Co-authored-by", pattern: /\ACo.*authored.*by.*\Z/i] + end + + register :format, memoize: true do + Configuration::Trailer[name: "Format", pattern: /\AFormat.*\Z/i] + end + + register :issue, memoize: true do + Configuration::Trailer[name: "Issue", pattern: /\AIssue.*\Z/i] + end + + register :milestone, memoize: true do + Configuration::Trailer[name: "Milestone", pattern: /\AMilestone.*\Z/i] + end + + register :reviewer, memoize: true do + Configuration::Trailer[name: "Reviewer", pattern: /\AReviewer.*\Z/i] + end + + register :signer, memoize: true do + Configuration::Trailer[name: "Signed-off-by", pattern: /\ASigned.*off.*by.*\Z/i] + end + + register :tracker, memoize: true do + Configuration::Trailer[name: "Tracker", pattern: /\ATracker.*\Z/i] + end end namespace :parsers do register(:person, memoize: true) { Gitt::Parsers::Person.new } end namespace :sanitizers do - register(:email) { Gitt::Sanitizers::Email } register(:signature) { Gitt::Sanitizers::Signature } end namespace :validators do register(:capitalization, memoize: true) { Validators::Capitalization.new } register(:email, memoize: true) { Validators::Email.new } register(:name, memoize: true) { Validators::Name.new } + register(:repeated_word, memoize: true) { Validators::RepeatedWord.new } end register :configuration, memoize: true do self[:defaults].add_loader(Etcher::Loaders::YAML.new(self[:xdg_config].active)) .then { |registry| Etcher.call registry }