[Swift] How to use SwiftLint (cocoapods)

until install

Open a terminal.

In the terminal, drag and drop the red frame after cd and paste it. Then remove the last/and subsequent/and press Enter. スクリーンショット 2021-01-10 20.18.58.png

cd /Users/sakamototatsuya/Desktop/swift/SwiftLintTestApp                 

Then enter:

pod init

Now that you have a podfile, open it below.

open podfile

Since the podfile can be opened, add SwiftLint as shown in the red frame.

pod 'SwiftLint'

スクリーンショット 2021-01-10 20.25.52.png

Save with comand + s and close. Return to the terminal and enter:

pod install

If it looks like the image, you have installed it. スクリーンショット 2021-01-10 20.30.28.png

Subsequent operations in Xcode

Close the Xcode you just opened and open it in workspace. スクリーンショット 2021-01-10 20.47.27.png

Operate in the order of the numbers. スクリーンショット 2021-01-10 20.34.15.png

Press + and select New Run Script Phase. Then, Run Script will be added below.

Enter the following code in the red frame.

"${PODS_ROOT}/SwiftLint/swiftlint"

スクリーンショット 2021-01-10 20.40.55.png

If you get a lot of warnings, I think it's working. スクリーンショット 2021-01-10 20.48.28.png

Reference site

https://github.com/realm/SwiftLint

Recommended Posts

[Swift] How to use SwiftLint (cocoapods)
[Swift] How to use UserDefaults
How to use Swift UIScrollView
[Swift] How to use Unwind segue
[Swift] How to use one option alert
How to use Map
How to use rbenv
How to use letter_opener_web
How to use fields_for
How to use java.util.logging
How to use map
How to use collection_select
How to use Twitter4J
How to use active_hash! !!
How to use MapStruct
How to use hidden_field_tag
How to use TreeSet
[How to use label]
How to use identity
How to use hashes
How to use JUnit 5
How to use Dozer.mapper
How to use Gradle
How to use org.immutables
How to use java.util.stream.Collector
How to use VisualVM
How to use Map
Note how to use Swift super basic TableView
[Java] How to use Map
How to use Chain API
[Java] How to use Map
How to use Priority Queuing
[Rails] How to use enum
How to use JUnit (beginner)
How to use Ruby return
[Rails] How to use enum
How to use @Builder (Lombok)
How to use java class
How to use Big Decimal
[Java] How to use Optional ②
[Java] How to use removeAll ()
How to use String [] args
How to use rails join
How to use Java Map
Ruby: How to use cookies
How to use dependent :: destroy
How to use Eclipse Debug_Shell
How to use Apache POI
[Rails] How to use validation
How to use Java variables
[Rails] How to use authenticate_user!
[Rails] How to use "kaminari"
How to use GC Viewer
[Java] How to use Optional ①
How to use Lombok now
[Creating] How to use JUnit
[Rails] How to use Scope
[Rails] How to use gem "devise"
How to use Lombok in Spring
How to use StringBurrer and Arrays.toString.
How to use arrays (personal memorandum)