This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# written by Noah | |
# 자세한 사용 방법은 https://noah-ios.dev/swiftlint-githooks/ 제 블로그를 참조해주세요! | |
LINT=$(which swiftlint) | |
if [[ -e "${LINT}" ]]; then | |
echo "🚀 SwiftLint 시작..." | |
echo "🔍 lint 적용 경로: $(pwd)" | |
count=0 | |
for file_path in $(git ls-files -m --exclude-from=.gitignore | grep ".swift$"); do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Combine | |
extension Publisher { | |
func withUnretained<T: AnyObject>(_ object: T) -> Publishers.CompactMap<Self, (T, Self.Output)> { | |
compactMap { [weak object] output in | |
guard let object = object else { | |
return nil | |
} | |
return (object, output) |