Files
facebook-ios-sdk/scripts/cleanup_code_formatting.sh
Jawwad Ahmad eb0dd45ba1 Enable SwiftFormat on more directories in the internal folder
Summary: Refactored and moved excludes into a new .swiftconfig in the internal folder

Reviewed By: samodom

Differential Revision: D39933313

fbshipit-source-id: 6875ea67efbe52b5203ac64fb10a1c445717e170
2022-09-30 13:04:49 -07:00

20 lines
645 B
Bash
Executable File

#!/bin/sh
#
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# This script runs a few shell commands for additional code formatting cleanup
# cd up one level if run from the scripts dir
CURRENT_DIR_NAME="${PWD##*/}"
if [ "$CURRENT_DIR_NAME" = "scripts" ]; then
cd ..
fi
# Remove UIColor prefix. (Note: Dosen't work for .cgColor ones ex: "layer.shadowColor = UIColor.black.cgColor")
git ls-files '*.swift' -z | xargs -0 perl -pi -e 's/(\.(?:background|text)Color) = UIColor(\.\w+)/\1 = \2/'