<commit_before># frozen_string_literal: true

require 'pathname'
require_relative 'tags'

module Signore
  class Settings
    def initialize(args = [])
      @args = args
    end

    def action
      args.first
    end

    # :reek:UtilityFunction
    def repo_path
      dir = ENV.fetch('XDG_DATA_HOME') { File.expand_path('~/.local/share') }
      Pathname.new("#{dir}/signore/signatures.yml")
    end

    def tags
      negated, required = tag_names.partition { |name| name.start_with?('~') }
      Tags.new(forbidden: negated.map { |neg| neg[1..-1] }, required: required)
    end

    private

    attr_reader :args

    def tag_names
      args[1..-1] or []
    end
  end
end<commit_msg>clarify Settings#tag_names implementation<commit_after># frozen_string_literal: true

require 'pathname'
require_relative 'tags'

module Signore
  class Settings
    def initialize(args = [])
      @args = args
    end

    def action
      args.first
    end

    # :reek:UtilityFunction
    def repo_path
      dir = ENV.fetch('XDG_DATA_HOME') { File.expand_path('~/.local/share') }
      Pathname.new("#{dir}/signore/signatures.yml")
    end

    def tags
      negated, required = tag_names.partition { |name| name.start_with?('~') }
      Tags.new(forbidden: negated.map { |neg| neg[1..-1] }, required: required)
    end

    private

    attr_reader :args

    def tag_names
      args.empty? ? [] : args[1..-1]
    end
  end
end
{'fraction_non_alphanumeric': 0.12386284114765571, 'fraction_numerical': 0.005598320503848845, 'mean_word_length': 2.704663212435233, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4857098', 'n_tokens_mistral': 494, 'n_tokens_neox': 479, 'n_words': 105}