From 75d7eba09c3d6dcf0d7638dff6bc29df3b792cf7 Mon Sep 17 00:00:00 2001 From: Sebastian Pickl Date: Sat, 18 May 2019 13:03:17 +0200 Subject: [PATCH] change formatting in commit hook --- Package.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 0142f7a..dcdc26d 100644 --- a/Package.swift +++ b/Package.swift @@ -73,12 +73,15 @@ let package = Package( // so changes can be reviewed. // https://github.com/nicholascross/Injectable/blob/master/Package.swift private let autoCorrect = #""" - git diff --staged --name-only | xargs git diff | md5 > .pre_format_hash + git --no-pager diff --staged --name-only | xargs git diff | md5 > .pre_format_hash swift run swiftformat . --disable strongifiedSelf --commas inline --swiftversion 5 swift run swiftlint autocorrect --path Sources/ Tests/ - git diff --staged --name-only | xargs git diff | md5 > .post_format_hash + git --no-pager diff --staged --name-only | xargs git diff | md5 > .post_format_hash diff .pre_format_hash .post_format_hash > /dev/null || { - echo "Staged files modified during commit" ; rm .pre_format_hash ; rm .post_format_hash ; exit 1 + echo "Staged files modified during commit" + rm .pre_format_hash + rm .post_format_hash + exit 1 } rm .pre_format_hash rm .post_format_hash