2017-03-20 9 views
0

.swiftlint.yml 파일 :Swift가 왜 내 사용자 정의 정규 표현식을 무시합니까?

 
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)"