<commit_before>require 'travis/build/appliances/base'
require 'travis/build/git'

module Travis
  module Build
    module Appliances
      class SetupFilter < Base
        def apply?
          secrets.any? and config[:filter_secrets]
        end

        def apply
          sh.raw <<-SHELL
            if [[ -z "$TRAVIS_FILTERED" ]]; then
              export TRAVIS_FILTERED=1
              #{exports}
              curl -sf -o ~/filter.rb #{Shellwords.escape(download_url)}
              exec ruby ~/filter.rb "/usr/bin/env TERM=xterm /bin/bash --login $HOME/build.sh" #{params}
            fi
          SHELL<commit_msg>appliances/setup_filter: don't run if app_host isn't set<commit_after>require 'travis/build/appliances/base'
require 'travis/build/git'

module Travis
  module Build
    module Appliances
      class SetupFilter < Base
        def apply?
          secrets.any? and !app_host.empty? and config[:filter_secrets]
        end

        def apply
          sh.raw <<-SHELL
            if [[ -z "$TRAVIS_FILTERED" ]]; then
              export TRAVIS_FILTERED=1
              #{exports}
              curl -sf -o ~/filter.rb #{Shellwords.escape(download_url)}
              exec ruby ~/filter.rb "/usr/bin/env TERM=xterm /bin/bash --login $HOME/build.sh" #{params}
            fi
          SHELL
{'fraction_non_alphanumeric': 0.10594512195121951, 'fraction_numerical': 0.001524390243902439, 'mean_word_length': 1.8984547461368653, 'pattern_counts': {'":': 0, '<': 9, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6260785', 'n_tokens_mistral': 414, 'n_tokens_neox': 403, 'n_words': 99}