https://github.com/realm/SwiftLint
Add SwiftLint pod
pod 'SwiftLint'
Add run script phase (use autocorrent for swiftlint to autocorrect files)
${PODS_ROOT}/SwiftLint/swiftlint autocorrect ${PODS_ROOT}/SwiftLint/swiftlint
Add
.swiftlint.yml
in project root folderopt\_in\_rules: - explicit\_type\_interface #- empty\_count #- missing\_docs disabled\_rules: - line\_length - trailing\_whitespace - trailing\_newline - identifier\_name - shorthand\_operator - function\_body\_length - orphaned\_doc\_comment - file\_length - legacy\_hashing - function\_parameter\_count - cyclomatic\_complexity - type\_body\_length - force\_cast - todo - large\_tuple - nesting #- colon #- comma #- mark #- trailing\_semicolon #- duplicate\_imports #- unneeded\_break\_in\_switch #- return\_arrow\_whitespace #- shorthand\_operator #- closure #- notification\_center\_detachment #- closure\_parameter\_position #- void\_return #- unused\_optional\_binding #- redundant\_optional\_initialization #- vertical\_whitespace #- for\_where #- no\_space\_in\_method\_call #- statement\_position #- redundant\_void\_return #- opening\_brace #- control\_statement - unused\_closure\_parameter #- protocol\_property\_accessors\_order #- legacy\_constructor #- implicit\_getter #- weak\_delegate #- class\_delegate\_protocol #- multiple\_closures\_with\_trailing\_closure included: excluded: - Pods - Carthage - fastlane - Tests - MyApp/Libraries - FacebookSDK - backup #analyzer\_rules: #- unused\_import #- unused\_private\_declaration #opt\_in\_rules: #- anyobject\_protocol #- array\_init #- attributes #- closure\_end\_indentation #- closure\_spacing #- collection\_alignment #- contains\_over\_first\_not\_nil #- empty\_count #- empty\_string #- empty\_xctest\_method #- explicit\_init #- extension\_access\_modifier #- fallthrough #- fatal\_error\_message #- file\_header #- file\_name #- first\_where #- identical\_operands #- joined\_default\_parameter #- let\_var\_whitespace #- last\_where #- literal\_expression\_end\_indentation #- lower\_acl\_than\_parent #- nimble\_operator #- number\_separator #- object\_literal #- operator\_usage\_whitespace #- overridden\_super\_call #- override\_in\_extension #- pattern\_matching\_keywords #- private\_action #- private\_outlet #- prohibited\_interface\_builder #- prohibited\_super\_call #- quick\_discouraged\_call #- quick\_discouraged\_focused\_test #- quick\_discouraged\_pending\_test #- redundant\_nil\_coalescing #- explicit\_type\_interface #- single\_test\_class #- sorted\_first\_last #- sorted\_imports #- static\_operator #- unavailable\_function #- unneeded\_parentheses\_in\_closure\_argument #- untyped\_error\_in\_catch #- vertical\_parameter\_alignment\_on\_call #- vertical\_whitespace\_closing\_braces #- vertical\_whitespace\_opening\_braces #- xct\_specific\_matcher #- yoda\_condition
반응형
'iPhone' 카테고리의 다른 글
Swift 팀원 및 원격 빌드를 위한 cocoapods 프레임워크 캐싱 (0) | 2020.11.18 |
---|---|
cocoapods-rome does not specify a Swift version and none of the targets (0) | 2020.11.11 |
AWS Simple Notification Service p12 (0) | 2020.06.10 |
Safe area / layout by code for iPhone X, XS, XR, XS Max (0) | 2020.06.10 |
Underline text / title in UIButton (0) | 2020.06.10 |