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.27 lib/cc/config/default_adapter.rb
codeclimate-0.85.26 lib/cc/config/default_adapter.rb
codeclimate-0.85.25 lib/cc/config/default_adapter.rb
codeclimate-0.85.24 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.54 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.53 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.52 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.51 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.50 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.49 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.48 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.47 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.46 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.45 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.44 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.43 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.42 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.41 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.40 lib/cc/config/default_adapter.rb
codeclimate-fede-0.85.39 lib/cc/config/default_adapter.rb