How to create a .swiftlint.yml file and where do I need to put it?

I want to use Swiftlint in my Swift project. I ran the Realm command and installed Swiftlint on brew install swiftlint . Next, I encountered the problem of creating a .swiftlint.yml file.

So please suggest me how will I continue?

+5
source share
4 answers

I found this video useful: https://www.youtube.com/watch?v=3MAlqOVIAwI

You can create .swiftlint.yml in Xcode and save it in the project directory. Just select File -> New -> File -> Empty

+5
source

If you are using a terminal:

  cd your_project_directory touch .swiftlint.yml 
+3
source

I install swift lint via cocoapods and then add a new file called .swiftlint.yml to the project root directory. See the YouTube link for details.
I found this video helpful: https://www.youtube.com/watch?v=cEA9BDVbjfI

0
source

I suggest you read the documentation :

Configure SwiftLint by adding the .swiftlint.yml file from the directory from which you will run SwiftLint.

I would suggest your project or source root.

The following is an extensive example file; start from there.

Regarding the available rules and defaults, there seems to be no good documentation other than running

swiftlint rules> swiftlint_rules.txt

and have a very wide screen.

-2
source

Source: https://habr.com/ru/post/1266105/


All Articles