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-0.85.12 lib/cc/config/default_adapter.rb
codeclimate-0.85.11 lib/cc/config/default_adapter.rb
codeclimate-0.85.10 lib/cc/config/default_adapter.rb
codeclimate-0.85.9 lib/cc/config/default_adapter.rb
codeclimate-0.85.8 lib/cc/config/default_adapter.rb
codeclimate-0.85.7 lib/cc/config/default_adapter.rb
codeclimate-0.85.6 lib/cc/config/default_adapter.rb
codeclimate-0.85.5 lib/cc/config/default_adapter.rb
codeclimate-0.85.4 lib/cc/config/default_adapter.rb
codeclimate-0.85.3 lib/cc/config/default_adapter.rb
codeclimate-0.85.2 lib/cc/config/default_adapter.rb
codeclimate-0.85.1 lib/cc/config/default_adapter.rb
codeclimate-0.85.0 lib/cc/config/default_adapter.rb
codeclimate-0.84.0 lib/cc/config/default_adapter.rb
codeclimate-0.83.0 lib/cc/config/default_adapter.rb
codeclimate-0.82.0 lib/cc/config/default_adapter.rb
codeclimate-0.81.0 lib/cc/config/default_adapter.rb
codeclimate-0.80.0 lib/cc/config/default_adapter.rb
codeclimate-0.79.0 lib/cc/config/default_adapter.rb
codeclimate-0.78.1 lib/cc/config/default_adapter.rb