lib/code_ownership.rb in code_ownership-1.32.8 vs lib/code_ownership.rb in code_ownership-1.32.9

- old
+ new

@@ -80,21 +80,27 @@ Private::OwnershipMappers::FileAnnotations.new.remove_file_annotation!(filename) end sig do params( - files: T::Array[String], autocorrect: T::Boolean, - stage_changes: T::Boolean + stage_changes: T::Boolean, + files: T.nilable(T::Array[String]), ).void end def validate!( - files: Private.tracked_files, autocorrect: true, - stage_changes: true + stage_changes: true, + files: nil ) Private.load_configuration! - tracked_file_subset = Private.tracked_files & files + + tracked_file_subset = if files + files.select{|f| Private.file_tracked?(f)} + else + Private.tracked_files + end + Private.validate!(files: tracked_file_subset, autocorrect: autocorrect, stage_changes: stage_changes) end # Given a backtrace from either `Exception#backtrace` or `caller`, find the # first line that corresponds to a file with assigned ownership