@서비 2024. 7. 12. 11:31

swiftLint를 사용하다보면 아래와 같은 문구가 발생하는 경우가 있는데, Whitespace 를 제거 해달 라는 의미이고, 

swift:164:1 Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)

 

해결 방법이 아래와 같다.

1. Xcode -> Settings -> Text Edition -> Editing 탭에 가면 Whitespace를 trim 하는 옵션이 있다.

 

Xcode whitespace trim option

 

2. swiftLint 옵션 사용

아래와 같은 내용을 command Line 에 작성하여 해결 할 수도 있다.

$ swiftlint autocorrect 또는,
$ swiftlint --fix