CocoaPods / CocoaPods-app

A full-featured and standalone installation of CocoaPods.
Other
1.23k stars 283 forks source link

Add a auto-beautifier for Podfiles #304

Open orta opened 8 years ago

orta commented 8 years ago

Idea: CocoaPods.app could handle your indentation, etc

This is useful in general, cause its less to think about. However, this is extra useful when using auto-complete which currently doesn't take tab indentation into account.

Implementation:

When running it on Artsy's Eigen:

~/d/i/a/eigen (master) ⏛  ruby-beautify Podfile -s -c 2
diff --git a/Podfile b/Podfile
index 1223224..29a5663 100644
--- a/Podfile
+++ b/Podfile
@@ -9,21 +9,21 @@ inhibit_all_warnings!
 #       the continuous build server.

 plugin 'cocoapods-keys', {
-    :project => "Artsy",
-    :target => "Artsy",
-    :keys => [
-        "ArtsyAPIClientSecret",
-        "ArtsyAPIClientKey",
-        "ArtsyFacebookAppID",
-        "ArtsyTwitterKey",
-        "ArtsyTwitterSecret",
-        "ArtsyTwitterStagingKey",
-        "ArtsyTwitterStagingSecret",
-        "SegmentProductionWriteKey",
-        "SegmentDevWriteKey",
-        "AdjustProductionAppToken",
-        "ArtsyEchoProductionToken",
-    ]
+  :project => "Artsy",
+  :target => "Artsy",
+  :keys => [
+    "ArtsyAPIClientSecret",
+    "ArtsyAPIClientKey",
+    "ArtsyFacebookAppID",
+    "ArtsyTwitterKey",
+    "ArtsyTwitterSecret",
+    "ArtsyTwitterStagingKey",
+    "ArtsyTwitterStagingSecret",
+    "SegmentProductionWriteKey",
+    "SegmentDevWriteKey",
+    "AdjustProductionAppToken",
+    "ArtsyEchoProductionToken",
+  ]
 }

 target 'Artsy' do
@@ -109,23 +109,23 @@ target 'Artsy' do
   pod 'Socket.IO-Client-Swift'

   target 'Artsy Tests' do
-      inherit! :search_paths
-
-      # Temporary, should be removed post CP 1.0
-      # https://github.com/facebook/ios-snapshot-test-case/pull/141
-      pod 'FBSnapshotTestCase', git: 'https://github.com/orta/ios-snapshot-test-case.git'
-      pod 'Expecta+Snapshots'
-      pod 'OHHTTPStubs'
-      pod 'XCTest+OHHTTPStubSuiteCleanUp'
-      pod 'Specta'
-      pod 'Expecta'
-      pod 'OCMock'
-      pod 'Forgeries/Mocks', :git => "https://github.com/ashfurrow/Forgeries.git", :branch => "application"
-
-      # Swift pods 🎉
-      pod 'Quick'
-      pod 'Nimble'
-      pod 'Nimble-Snapshots'
+    inherit! :search_paths
+
+    # Temporary, should be removed post CP 1.0
+    # https://github.com/facebook/ios-snapshot-test-case/pull/141
+    pod 'FBSnapshotTestCase', git: 'https://github.com/orta/ios-snapshot-test-case.git'
+    pod 'Expecta+Snapshots'
+    pod 'OHHTTPStubs'
+    pod 'XCTest+OHHTTPStubSuiteCleanUp'
+    pod 'Specta'
+    pod 'Expecta'
+    pod 'OCMock'
+    pod 'Forgeries/Mocks', :git => "https://github.com/ashfurrow/Forgeries.git", :branch => "application"
+
+    # Swift pods 🎉
+    pod 'Quick'
+    pod 'Nimble'
+    pod 'Nimble-Snapshots'
   end
 end
segiddins commented 8 years ago

If possible I'd prefer to use rubocop since that's what we use across all the different CocoaPods projects