File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -491,9 +491,25 @@ lane :lint_pr do
491491 danger ( dangerfile : 'Dangerfile' ) if is_ci
492492end
493493
494+ def check_foundation_import
495+ files_missing_imports = [ ]
496+ Dir . glob ( "Sources/**/*.swift" ) . each do |file |
497+ next if file =~ /(StreamNuke|StreamSwiftyGif)/
498+
499+ files_missing_imports << file unless File . read ( file ) . match? ( /import (Foundation|UIKit|SwiftUI|Combine|StreamChat)/ )
500+ end
501+
502+ unless files_missing_imports . empty?
503+ UI . error ( "Files missing 'Foundation' import:" )
504+ files_missing_imports . each { |file | UI . error ( "- #{ file } " ) }
505+ UI . user_error! ( "Lint check failed." )
506+ end
507+ end
508+
494509desc 'Run source code formatting/linting'
495510lane :run_swift_format do |options |
496511 Dir . chdir ( '..' ) do
512+ check_foundation_import
497513 strict = options [ :strict ] ? '--lint' : nil
498514 sources_matrix [ :swiftformat ] . each do |path |
499515 sh ( "swiftformat #{ strict } --config .swiftformat #{ path } " )
You can’t perform that action at this time.
0 commit comments