Sha256: dcf2146c4b4ced40fb52d50271a1e6a140954f70a59b5a2533f856d92710d2c4

Contents?: true

Size: 862 Bytes

Versions: 3

Compression:

Stored size: 862 Bytes

Contents

# typed: strict

module CodeOwnership
  module Private
    module Validations
      class NoOverlappingGlobs
        extend T::Sig
        extend T::Helpers
        include Interface

        sig { override.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)
          overlapping_globs = OwnershipMappers::TeamGlobs.new.find_overlapping_globs

          errors = T.let([], T::Array[String])

          if overlapping_globs.any?
            errors << <<~MSG
              `owned_globs` cannot overlap between teams. The following globs overlap:

              #{overlapping_globs.map { |overlap| "- #{overlap.description}"}.join("\n")}
            MSG
          end

          errors
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
code_ownership-1.31.1 lib/code_ownership/private/validations/no_overlapping_globs.rb
code_ownership-1.31.0 lib/code_ownership/private/validations/no_overlapping_globs.rb
code_ownership-1.30.0 lib/code_ownership/private/validations/no_overlapping_globs.rb