Module: Collie::Config::Schema

Defined in:
lib/collie/config/schema.rb

Overview

JSON Schema for .collie.yml files.

Constant Summary collapse

SEVERITIES =
%w[error warning convention info].freeze
SEVERITY_SCHEMA =
{
  "type" => "string",
  "enum" => SEVERITIES
}.freeze
FORMATTER_PROPERTIES =
{
  "indent_size" => {
    "type" => "integer",
    "minimum" => 1
  },
  "align_tokens" => {
    "type" => "boolean"
  },
  "align_alternatives" => {
    "type" => "boolean"
  },
  "blank_lines_around_sections" => {
    "type" => "integer",
    "minimum" => 0
  },
  "max_line_length" => {
    "type" => "integer",
    "minimum" => 1
  }
}.freeze

Class Method Summary collapse

Class Method Details

.to_hObject



36
37
38
39
40
41
42
43
44
45
# File 'lib/collie/config/schema.rb', line 36

def to_h
  {
    "$schema" => "https://json-schema.org/draft/2020-12/schema",
    "title" => "Collie configuration",
    "type" => "object",
    "additionalProperties" => false,
    "properties" => properties,
    "$defs" => definitions
  }
end