<commit_before>#!/usr/bin/env bash

info() {
	printf "\033[00;34m$@\033[0m\n"
}

update() {
	# Install Homebrew or make sure it's up to date.
	which -s brew
	if [[ $? != 0 ]] ; then
		info "Installing"
		ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
	else
		info "Updating"
		brew update
		brew upgrade
	fi

	# Disable analytics.
	brew analytics off
}

installEssentials() {
	info "Installing essentials"

	brew install fd
	brew install fish
	brew install fzf
	brew install git
	brew install gnupg
	brew install neovim
	brew install pinentry-mac
	brew install ripgrep
	brew install swig
	brew install tmux
	brew install vim
}

installBasics() {
	info "Installing basics"

	brew install bat
	brew install boost
	brew install clang-format
	brew install cloc
	brew install cmake
	brew install creduce
	brew install ctags
	brew install doxygen
	brew install git-delta
	brew install git-lfs
	brew install github/gh/gh
	brew install graphviz
	brew install highlight
	brew install htop
	brew install hyperfine
	brew install imagemagick
	brew install lcov
	brew install libxml2
	brew install lua@5.3
	brew install ncdu
	brew install neofetch
	brew install ninja
	brew install node
	brew install pandoc
	brew install patchutils
	brew install python
	brew install re2c
	brew install redis
	brew install rsync
	brew install sccache
	brew install the_silver_searcher
	brew install tig
	brew install tree
	brew install vbindiff
	brew install xz
	brew install zsh
}

installExtras() {
	info "Installing extras"

	brew install afl-fuzz
	brew install archey
	brew install binutils
	brew install coreutils
	brew install cppcheck
	brew install distcc
	brew install ffmpeg
	brew install findutils
	brew install gdb
	brew install gnu-sed
	brew install gnutls
	brew install gts
	brew install libiconv
	brew install mosh
	brew install radare2
	brew install ranger
	brew install shellcheck
	brew install valgrind
	brew install wget --with-iri
	brew install wireshark --with-qt5
}

linkApps() {
	info "Linking apps"

	brew linkapps
}

cleanup() {
	info "Cleanup"

	brew cleanup
}

list() {
	info "List"

	brew list
}


help() {
	echo "Usage: $(basename "$0") [options]" >&2
	echo
	echo "   -i, --install          Install"
	echo "   -e, --extras           Install extras"
	echo "   -u, --update           Update brew and formulae"
	echo "   -l, --list             List installed formulae"
	echo "   -m, --minimal          Install just the essentials"
	echo
	exit 1
}

if [ $# -eq 0 ]; then
	help
else
	for i in "$@"
	do
		case $i in
			-m|--minimal)
				update
				installEssentials
				cleanup
				list
				shift
				;;
			-i|--install)
				update
				installEssentials
				installBasics
				cleanup
				list
				shift
				;;
			-e|--extras)
				update
				installExtras
				cleanup
				list
				shift
				;;
			-f|--fix)
				shift
				;;
			-u|--update)
				update
				cleanup
				shift
				;;
			-l|--list)
				list
				shift
				;;
			*)
				help
				shift
				;;
		esac
	done
fi
<commit_msg>[scripts] Install brow formulae in a single brew invocation<commit_after>#!/usr/bin/env bash

info() {
  printf "\033[00;34m$@\033[0m\n"
}

update() {
  # Install Homebrew or make sure it's up to date.
  which -s brew
  if [[ $? != 0 ]] ; then
    info "Installing"
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  else
    info "Updating"
    brew update
    brew upgrade
  fi

  # Disable analytics.
  brew analytics off
}

installEssentials() {
  info "Installing essentials"

  brew install \
    fd \
    fish \
    fzf \
    git \
    gnupg \
    neovim \
    pinentry-mac \
    ripgrep \
    swig \
    tmux \
    vim
}

installBasics() {
  info "Installing basics"

  brew install \
    bat \
    boost \
    clang-format \
    cloc \
    cmake \
    creduce \
    ctags \
    doxygen \
    git-delta \
    git-lfs \
    github/gh/gh \
    graphviz \
    highlight \
    htop \
    hyperfine \
    imagemagick \
    lcov \
    libxml2 \
    lua@5.3 \
    ncdu \
    neofetch \
    ninja \
    node \
    pandoc \
    patchutils \
    python \
    re2c \
    redis \
    rsync \
    sccache \
    the_silver_searcher \
    tig \
    tree \
    vbindiff \
    xz \
    zsh
}

installExtras() {
  info "Installing extras"

  brew install \
    afl-fuzz \
    archey \
    binutils \
    coreutils \
    cppcheck \
    distcc \
    ffmpeg \
    findutils \
    gdb \
    gnu-sed \
    gnutls \
    gts \
    libiconv \
    mosh \
    radare2 \
    ranger \
    shellcheck \
    valgrind \
    wget --with-iri \
    wireshark --with-qt5
}

linkApps() {
  info "Linking apps"

  brew linkapps
}

cleanup() {
  info "Cleanup"

  brew cleanup
}

list() {
  info "List"

  brew list
}


help() {
  echo "Usage: $(basename "$0") [options]" >&2
  echo
  echo "   -i, --install          Install"
  echo "   -e, --extras           Install extras"
  echo "   -u, --update           Update brew and formulae"
  echo "   -l, --list             List installed formulae"
  echo "   -m, --minimal          Install just the essentials"
  echo
  exit 1
}

if [ $# -eq 0 ]; then
  help
else
  for i in "$@"
  do
    case $i in
      -m|--minimal)
        update
        installEssentials
        cleanup
        list
        shift
        ;;
      -i|--install)
        update
        installEssentials
        installBasics
        cleanup
        list
        shift
        ;;
      -e|--extras)
        update
        installExtras
        cleanup
        list
        shift
        ;;
      -f|--fix)
        shift
        ;;
      -u|--update)
        update
        cleanup
        shift
        ;;
      -l|--list)
        list
        shift
        ;;
      *)
        help
        shift
        ;;
    esac
  done
fi

{'fraction_non_alphanumeric': 0.08711465188777277, 'fraction_numerical': 0.007620367163145133, 'mean_word_length': 1.8660049627791564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '604593', 'n_tokens_mistral': 2187, 'n_tokens_neox': 1977, 'n_words': 596}