Sha256: bbf05bc20b6a35c815ec42cd1baef41084bca4d6607df9877685f7b4b74a6166

Contents?: true

Size: 777 Bytes

Versions: 95

Compression:

Stored size: 777 Bytes

Contents

module CC
  class Config
    module Validation
      class JSON < FileValidator
        private

        def validate
          @data = ::JSON.parse(File.read(path))

          return unless validate_hash_data

          validate_version
          validate_prepare
          validate_engines("plugins")
          validate_checks
          validate_exclude_pattern("exclude_patterns")

          warn_unrecognized_keys(%w[checks prepare plugins exclude_patterns version])
        rescue ::JSON::ParserError => ex
          errors << "Unable to parse: #{ex.message}"
        end

        def validate_version
          unless data.key?("version")
            warnings << %(missing 'version' key. Please add `"version": "2"`)
          end
        end
      end
    end
  end
end

Version data entries

95 entries across 95 versions & 2 rubygems

Version Path
codeclimate-0.85.27 lib/cc/config/validation/json.rb
codeclimate-0.85.26 lib/cc/config/validation/json.rb
codeclimate-0.85.25 lib/cc/config/validation/json.rb
codeclimate-0.85.24 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.54 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.53 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.52 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.51 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.50 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.49 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.48 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.47 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.46 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.45 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.44 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.43 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.42 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.41 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.40 lib/cc/config/validation/json.rb
codeclimate-fede-0.85.39 lib/cc/config/validation/json.rb