<commit_before>RUBY := $(shell which ruby)
BREW := $(shell which brew)
SWIFT := $(shell which swift)
SWIFTLINT := $(shell which swiftlint)


# Generates the xcodeproj and compiles the executable
build: xcodeproj
	$(SWIFT) build
.PHONY: build

xcodeproj:
	$(SWIFT) package generate-xcodeproj --enable-code-coverage
.PHONY: xcodeproj


# Runs the debug executable to simplify the developement cycle. The expected
# pattern would be:
#
# 1. Change some code.
# 2. Run `make build run` or `make build run CMD=scan` if you want to test a
#    specific command.
run:
	./.build/debug/github-scanner $(CMD)
.PHONY: run


lint:
	$(SWIFTLINT) lint
.PHONY: lint

test:
	$(SWIFT) test
.PHONY: test


# Installs the required dependencies.
dependencies:
ifndef RUBY
	$(error "Couldn't find Ruby installed.")
endif
	@$(MAKE) install-homebrew install-swiftlint


install-homebrew:
ifndef BREW
	$(RUBY) -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
	brew update
endif


install-swiftlint:
ifndef SWIFTLINT
	brew install swiftlint
else
	brew outdated swiftlint || brew upgrade swiftlint
endif
<commit_msg>Fix brew references in make tasks.<commit_after>RUBY := $(shell which ruby)
BREW := $(shell which brew)
SWIFT := $(shell which swift)
SWIFTLINT := $(shell which swiftlint)
CURL := $(shell which curl)


# Generates the xcodeproj and compiles the executable
build: xcodeproj
	$(SWIFT) build
.PHONY: build

xcodeproj:
	$(SWIFT) package generate-xcodeproj --enable-code-coverage
.PHONY: xcodeproj


# Runs the debug executable to simplify the developement cycle. The expected
# pattern would be:
#
# 1. Change some code.
# 2. Run `make build run` or `make build run CMD=scan` if you want to test a
#    specific command.
run:
	./.build/debug/github-scanner $(CMD)
.PHONY: run


lint:
	$(SWIFTLINT) lint
.PHONY: lint

test:
	$(SWIFT) test
.PHONY: test


# Installs the required dependencies.
dependencies:
ifndef RUBY
	$(error "Couldn't find Ruby installed.")
endif
	@$(MAKE) install-homebrew install-swiftlint


install-homebrew:
ifndef BREW
	$(RUBY) -e "$($(CURL) -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
	$(BREW) update
endif


install-swiftlint:
ifndef SWIFTLINT
	$(BREW) install swiftlint
else
	$(BREW) outdated swiftlint || $(BREW) upgrade swiftlint
endif

{'fraction_non_alphanumeric': 0.11478933791917455, 'fraction_numerical': 0.0017196904557179708, 'mean_word_length': 4.462441314553991, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4562932', 'n_tokens_mistral': 841, 'n_tokens_neox': 796, 'n_words': 267}