Bundler与SwiftLint冲突

个人memo用文章

同时使用SwiftLint和Bundler时,务必注意把在.swiftlint.yml中把vendor文件夹除外!!

Xcode中莫名出现了一堆fastlane的报错,懵逼了半天。
把build settings和build phase中的path翻了个底朝天也没发现为什么vendor文件下的东西会编译报错。

最后终于想起来把报错信息在Log中打印一遍。

Linting 'ScreengrabfileProtocol.swift' (306/332)
/Users/.../dev/.../vendor/bundle/ruby/2.6.0/gems/fastlane-2.137.0/fastlane/swift/RubyCommand.swift:60:57: warning: Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
/Users/.../dev/.../vendor/bundle/ruby/2.6.0/gems/fastlane-2.137.0/fastlane/swift/RubyCommand.swift:114:26: error: Empty Count Violation: Prefer checking `isEmpty` over comparing `count` to zero. (empty_count)

给个中指先...

excluded:
  - Carthage
  - Pods
  ...
  - vendor

.swiftlint.yml文件中除外后搞定

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容