{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/solidarity/latest.json",
  "title": "Solidarity",
  "description": "A rule-set and config for the Solidarity JSON checker",
  "x-lintel": {
    "source": "https://www.schemastore.org/solidaritySchema.json",
    "sourceSha256": "ac66a8757e426bad709b64c6c090dca8b8a762e59ae194b2405cb78f92b69f9f",
    "fileMatch": [
      ".solidarity",
      ".solidarity.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "config": {
      "type": "object",
      "properties": {
        "output": {
          "description": "Identify what kind output should happen when a check is called",
          "type": "string",
          "enum": [
            "moderate",
            "verbose",
            "silent"
          ]
        }
      }
    },
    "requirements": {
      "description": "List of requirement rules for your particular environment",
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "object",
          "oneOf": [
            {
              "$ref": "#/$defs/cli"
            },
            {
              "$ref": "#/$defs/dir"
            },
            {
              "$ref": "#/$defs/file"
            },
            {
              "$ref": "#/$defs/env"
            },
            {
              "$ref": "#/$defs/shell"
            },
            {
              "$ref": "#/$defs/custom"
            }
          ]
        },
        "minItems": 1,
        "uniqueItems": true
      }
    }
  },
  "required": [
    "requirements"
  ],
  "$defs": {
    "cli": {
      "description": "CLI Rule",
      "type": "object",
      "properties": {
        "rule": {
          "enum": [
            "cli"
          ]
        },
        "binary": {
          "type": "string"
        },
        "semver": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "line": {
          "type": [
            "string",
            "integer"
          ]
        },
        "matchIndex": {
          "type": "integer"
        },
        "platform": {
          "enum": [
            "darwin",
            "macos",
            "freebsd",
            "linux",
            "sunos",
            "win32",
            "windows"
          ]
        },
        "error": {
          "type": "string"
        },
        "ci": {
          "type": "boolean"
        }
      },
      "required": [
        "rule",
        "binary"
      ]
    },
    "dir": {
      "description": "Dir Rule",
      "type": "object",
      "properties": {
        "rule": {
          "enum": [
            "dir",
            "directory"
          ]
        },
        "platform": {
          "enum": [
            "darwin",
            "macos",
            "freebsd",
            "linux",
            "sunos",
            "win32",
            "windows"
          ]
        },
        "error": {
          "type": "string"
        },
        "ci": {
          "type": "boolean"
        }
      },
      "required": [
        "rule",
        "location"
      ]
    },
    "file": {
      "description": "File Rule",
      "type": "object",
      "properties": {
        "rule": {
          "enum": [
            "file"
          ]
        },
        "platform": {
          "enum": [
            "darwin",
            "macos",
            "freebsd",
            "linux",
            "sunos",
            "win32",
            "windows"
          ]
        },
        "error": {
          "type": "string"
        },
        "ci": {
          "type": "boolean"
        }
      },
      "required": [
        "rule",
        "location"
      ]
    },
    "env": {
      "description": "ENV Rule",
      "type": "object",
      "properties": {
        "rule": {
          "enum": [
            "env"
          ]
        },
        "platform": {
          "enum": [
            "darwin",
            "macos",
            "freebsd",
            "linux",
            "sunos",
            "win32",
            "windows"
          ]
        },
        "error": {
          "type": "string"
        },
        "ci": {
          "type": "boolean"
        }
      },
      "required": [
        "rule",
        "variable"
      ]
    },
    "shell": {
      "description": "Shell Rule",
      "type": "object",
      "properties": {
        "rule": {
          "enum": [
            "shell"
          ]
        },
        "platform": {
          "enum": [
            "darwin",
            "macos",
            "freebsd",
            "linux",
            "sunos",
            "win32",
            "windows"
          ]
        },
        "error": {
          "type": "string"
        },
        "ci": {
          "type": "boolean"
        },
        "match": {
          "type": "string",
          "description": "A regexp to search the output."
        }
      },
      "required": [
        "rule",
        "match"
      ]
    },
    "custom": {
      "description": "Custom Rule",
      "type": "object",
      "required": [
        "rule",
        "plugin",
        "name"
      ],
      "properties": {
        "rule": {
          "enum": [
            "custom"
          ]
        },
        "plugin": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "platform": {
          "enum": [
            "darwin",
            "macos",
            "freebsd",
            "linux",
            "sunos",
            "win32",
            "windows"
          ]
        },
        "error": {
          "type": "string"
        },
        "ci": {
          "type": "boolean"
        },
        "match": {
          "type": "string",
          "description": "A regexp to search the output."
        }
      },
      "additionalProperties": true
    }
  },
  "id": "https://json.schemastore.org/solidaritySchema.json"
}
