Sha256: c2b4d7c3e75626e76114cb04a6713af65414d21f136b130291998068018ab5b6

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 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
        in_sorbet_project!
        config = Spoom::Sorbet::Config.parse_file(sorbet_config)

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

        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

3 entries across 3 versions & 1 rubygems

Version Path
spoom-1.0.7 lib/spoom/cli/config.rb
spoom-1.0.6 lib/spoom/cli/config.rb
spoom-1.0.5 lib/spoom/cli/config.rb