From d2de17afb91a3fa5c504e48062f240b886f289d9 Mon Sep 17 00:00:00 2001 From: Michelle Linington Date: Thu, 7 Oct 2021 20:39:46 -0700 Subject: [PATCH] Fix lint script --- Scripts/EmojiGenerator.swift | 3 +-- Scripts/precommit.py | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Scripts/EmojiGenerator.swift b/Scripts/EmojiGenerator.swift index c3c0473459..cbd3491706 100755 --- a/Scripts/EmojiGenerator.swift +++ b/Scripts/EmojiGenerator.swift @@ -1,9 +1,8 @@ +#!/usr/bin/env xcrun --sdk macosx swift // // Copyright (c) 2021 Open Whisper Systems. All rights reserved. // -#!/usr/bin/env xcrun --sdk macosx swift - import Foundation class EmojiGenerator { diff --git a/Scripts/precommit.py b/Scripts/precommit.py index 5b027f8c6b..b65f09e428 100755 --- a/Scripts/precommit.py +++ b/Scripts/precommit.py @@ -336,6 +336,12 @@ def process(filepath): text = sort_class_statements(filepath, filename, file_ext, text) lines = text.split('\n') + + shebang = "" + if lines[0].startswith('#!'): + shebang = lines[0] + '\n' + lines = lines[1:] + while lines and lines[0].startswith('//'): lines = lines[1:] text = '\n'.join(lines) @@ -348,7 +354,7 @@ def process(filepath): ''' % ( datetime.datetime.now().year, ) - text = header + text + '\n' + text = shebang + header + text + '\n' if original_text == text: return