How to force error on SwiftLint instead of warnings?

别说谁变了你拦得住时间么 提交于 2020-02-03 23:42:40

问题


my question is very simple, how do I make all warnings become errors on SwiftLint? (without manually configuring each rule separately)


回答1:


To integrate SwiftLint to your project, you normally need to add a Run Script Phase, as described by the doc.

If you used the CocoaPods installation, this script would look like:

"${PODS_ROOT}/SwiftLint/swiftlint"

That is where you can customize the command line options. In your case, you may want to use:

"${PODS_ROOT}/SwiftLint/swiftlint" lint --strict

The warnings will still be displayed as warnings, but an extra error will be given, preventing running or archiving:

Command /bin/sh failed with exit code 3

That is the desired error.



来源:https://stackoverflow.com/questions/42406844/how-to-force-error-on-swiftlint-instead-of-warnings

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!