2017-03-20 9 views
0

マイ.swiftlint.ymlファイル:Swift lintがカスタム正規表現を無視するのはなぜですか?

 
disabled_rules: 
    - trailing_whitespace 
    - mark 
    - line_length 
    - force_cast 
    - variable_name 
    - force_try 
    - cyclomatic_complexity 
    - function_body_length 
    - type_body_length 
    - file_length 
    - type_name 

excluded: 
    - Pods 

custom_rules: 
    press_enter_after_object_definition: 
    regex: "(class|enum).*" 

結果は以下の通りです:

enter image description here

をそれだけで最初の一致を発見したのはなぜ?

すべての行をenumまたはclassというキーワードで検索する必要があります。

答えて

1

.*を削除します。これは、改行以外のものと一致することを意味します。だから、成功した試合の最初の改行の後、SwiftLintで死ぬようです。

これは動作します:

press_enter_after_object_definition: 
    regex: "(class|enum)"