Sha256: ff20226521dde0e6e4f4420c38854055ffb94460b7bc798cba78952c4ee25772

Contents?: true

Size: 720 Bytes

Versions: 10

Compression:

Stored size: 720 Bytes

Contents

# typed: strict

module CodeOwnership
  module Validator
    extend T::Sig
    extend T::Helpers

    interface!

    sig { abstract.params(files: T::Array[String], autocorrect: T::Boolean, stage_changes: T::Boolean).returns(T::Array[String]) }
    def validation_errors(files:, autocorrect: true, stage_changes: true)
    end

    class << self
      extend T::Sig

      sig { params(base: T::Class[Validator]).void }
      def included(base)
        @validators ||= T.let(@validators, T.nilable(T::Array[T::Class[Validator]]))
        @validators ||= []
        @validators << base
      end

      sig { returns(T::Array[Validator]) }
      def all
        (@validators || []).map(&:new)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
code_ownership-1.36.2 lib/code_ownership/validator.rb
code_ownership-1.36.1 lib/code_ownership/validator.rb
code_ownership-1.36.0 lib/code_ownership/validator.rb
code_ownership-1.35.0 lib/code_ownership/validator.rb
code_ownership-1.34.2 lib/code_ownership/validator.rb
code_ownership-1.34.1 lib/code_ownership/validator.rb
code_ownership-1.33.1 lib/code_ownership/validator.rb
code_ownership-1.33.0 lib/code_ownership/validator.rb
code_ownership-1.32.19 lib/code_ownership/validator.rb
code_ownership-1.32.18 lib/code_ownership/validator.rb