<commit_before>BUILDCLEANER := xcpretty
TESTCLEANER := xcpretty
ifeq (,$(shell command -v xcpretty))
	BUILDCLEANER := egrep '^(/.+:[0-9+:[0-9]+:.(error|warning):|fatal|===)'
	TESTCLEANER := egrep -v '^Test Suite|^Test Case|^\t Executed'
endif

.PHONY: build test clean

build: 
	@xcodebuild TOOLCHAINS=swift | ${BUILDCLEANER}

test: build
	@xcodebuild TOOLCHAINS=swift -scheme SwiftShell test | ${TESTCLEANER}
	
	@echo
	@echo "=== RUN SwiftShell TEST SCRIPTS (SwiftShellTests/Scripts/runtests.bash) ==="
	@cd ./Tests/Scripts/ && ./runtests.bash 
	@echo

clean:
	-rm -rf build
	-rm -rf .build

<commit_msg>Makefile automatically discovers the correct Swift toolchain to use.<commit_after>BUILDCLEANER := xcpretty
TESTCLEANER := xcpretty
ifeq (,$(shell command -v xcpretty))
	BUILDCLEANER := egrep '^(/.+:[0-9+:[0-9]+:.(error|warning):|fatal|===)'
	TESTCLEANER := egrep -v '^Test Suite|^Test Case|^\t Executed'
endif

export TOOLCHAINS=$(shell defaults read /Library/Developer/Toolchains/swift-`cat .swift-version`.xctoolchain/Info CFBundleIdentifier || echo swift)

.PHONY: build test clean

build: 
	@xcodebuild | ${BUILDCLEANER}

test: build
	@xcodebuild -scheme SwiftShell test | ${TESTCLEANER}
	
	@echo
	@echo "=== RUN SwiftShell TEST SCRIPTS (SwiftShellTests/Scripts/runtests.bash) ==="
	@cd ./Tests/Scripts/ && ./runtests.bash 
	@echo

clean:
	-rm -rf build
	-rm -rf .build


{'fraction_non_alphanumeric': 0.16231884057971013, 'fraction_numerical': 0.005797101449275362, 'mean_word_length': 4.706611570247934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5742535', 'n_tokens_mistral': 562, 'n_tokens_neox': 522, 'n_words': 123}