Sha256: 9dc7c33a606c4d1e6e6f2ea648b21a19e101c9563dc9b6f6c7b4b1a678523206

Contents?: true

Size: 1.18 KB

Versions: 13

Compression:

Stored size: 1.18 KB

Contents

# typed: true
# frozen_string_literal: true

require_relative "../file_tree"
require_relative "../sorbet/config"

module Spoom
  module Cli
    class Config < Thor
      include Helper

      default_task :show

      desc "show", "Show Sorbet config"
      def show
        context = context_requiring_sorbet!
        config = context.sorbet_config
        config_path = Pathname.new("#{exec_path}/#{Spoom::Sorbet::CONFIG_PATH}").cleanpath

        say("Found Sorbet config at `#{config_path}`.")

        say("\nPaths typechecked:")
        if config.paths.empty?
          say(" * (default: .)")
        else
          config.paths.each do |path|
            say(" * #{path}")
          end
        end

        say("\nPaths ignored:")
        if config.ignore.empty?
          say(" * (default: none)")
        else
          config.ignore.each do |path|
            say(" * #{path}")
          end
        end

        say("\nAllowed extensions:")
        if config.allowed_extensions.empty?
          say(" * .rb (default)")
          say(" * .rbi (default)")
        else
          config.allowed_extensions.each do |ext|
            say(" * #{ext}")
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spoom-1.5.0 lib/spoom/cli/config.rb
spoom-1.4.2 lib/spoom/cli/config.rb
spoom-1.4.1 lib/spoom/cli/config.rb
spoom-1.4.0 lib/spoom/cli/config.rb
spoom-1.3.3 lib/spoom/cli/config.rb
spoom-1.3.2 lib/spoom/cli/config.rb
spoom-1.3.1 lib/spoom/cli/config.rb
spoom-1.3.0 lib/spoom/cli/config.rb
spoom-1.2.4 lib/spoom/cli/config.rb
spoom-1.2.3 lib/spoom/cli/config.rb
spoom-1.2.2 lib/spoom/cli/config.rb
spoom-1.2.1 lib/spoom/cli/config.rb
spoom-1.2.0 lib/spoom/cli/config.rb