Avatar
Kishikawa Katsumi 11/15/2018 12:03 PM
そういうルールがあるかどうかは知らないですが(たぶん無い)、自分でルールを追加したらいいですよ。 ASTを使ったほうが確実ですが、簡単でいいなら、正規表現だけでもできます。それなら.swiftlint.ymlだけで追加できるので簡単です。
12:05 PM
must_have_weak_cupture_argument_in_subscribe: name: Must have weak capture argument in Rx#subscribe method match_kinds: - keyword - identifier - typeidentifier - attribute.builtin included: "./(Folio|Redux)/.*\\.swift" regex: rx.tap\s\s*.subscribe\(onNext:\s\{\s(?!\[weak) message: Must have weak capture argument in Rx#subscribe method severity: error ^ これはsubscribeの中はweakキャプチャしなければならない、というルールですが、こんな感じで追加したらいいと思います。
🙏 3