Sha256: 05a3f1b53594ea978ff46121ce8996e2d8d0dd04448d2f495283e217057224a2

Contents?: true

Size: 1.15 KB

Versions: 89

Compression:

Stored size: 1.15 KB

Contents

module CC
  class Config
    class DefaultAdapter
      # intentionally not sorted: we want them in a particular order
      ENGINES = {
        "structure".freeze => "stable".freeze,
        "duplication".freeze => "stable".freeze,
      }.freeze

      EXCLUDE_PATTERNS = %w[
        config/
        db/
        dist/
        features/
        **/node_modules/
        script/
        **/spec/
        **/test/
        **/tests/
        Tests/
        **/vendor/
        **/*_test.go
        **/*.d.ts
      ].freeze

      attr_reader :config

      def initialize(data = {})
        @config = data

        apply_default_excludes
        apply_default_engines
      end

      private

      def apply_default_engines
        config["plugins"] ||= {}

        ENGINES.each do |name, channel|
          config["plugins"][name] ||= {}
          unless [true, false].include?(config["plugins"][name]["enabled"])
            config["plugins"][name]["enabled"] = true
          end
          config["plugins"][name]["channel"] ||= channel
        end
      end

      def apply_default_excludes
        config["exclude_patterns"] ||= EXCLUDE_PATTERNS
      end
    end
  end
end

Version data entries

89 entries across 89 versions & 2 rubygems

Version Path
codeclimate-fede-0.85.38 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.37 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.36 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.35 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.33 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.32 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.31 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.30 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.21 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.24 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.23 lib/cc/config/default_adapter.rb
codeclimate-0.85.23 lib/cc/config/default_adapter.rb
codeclimate-0.85.22 lib/cc/config/default_adapter.rb
codeclimate-0.85.21 lib/cc/config/default_adapter.rb
codeclimate-0.85.19 lib/cc/config/default_adapter.rb
codeclimate-0.85.18 lib/cc/config/default_adapter.rb
codeclimate-0.85.17 lib/cc/config/default_adapter.rb
codeclimate-0.85.15 lib/cc/config/default_adapter.rb
codeclimate-0.85.14 lib/cc/config/default_adapter.rb
codeclimate-0.85.13 lib/cc/config/default_adapter.rb