lib/swiftformat/plugin.rb in danger-swiftformat-0.0.2 vs lib/swiftformat/plugin.rb in danger-swiftformat-0.0.3
- old
+ new
@@ -25,9 +25,12 @@
raise "Could not find SwiftFormat executable" unless swiftformat.installed?
# Find Swift files
swift_files = find_swift_files
+ # Stop processing if there are no swift files
+ return if swift_files.empty?
+
# Run swiftformat
results = swiftformat.check_format(swift_files)
# Stop processing if the errors array is empty
return if results[:errors].empty?