{
    "$schema": "http://json-schema.org/draft-04/schema",
    "title": "This document describes the engine definition",
    "description": "The meta information of engine",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "The engine name"
        },
        "executable": {
            "type": "string",
            "description": "The engine executable name; by default it's equal to engine name"
        },
        "runLocally": {
            "type": "boolean",
            "description": "Way how to run engine. If engine installed locally for current project, than cant execute it with just engine name",
            "default": false
        },
        "description": {
            "type": "string",
            "description": "The engine description"
        },
        "url": {
            "type": "string",
            "description": "The engine url or homepage",
            "format": "uri"
        },
        "version": {
            "type": "string",
            "description": "The engine version"
        },
        "languages": {
            "type": "array",
            "description": "The list of supported languages",
            "items": {
                "type": "string",
                "enum": [
                    "coffeescript",
                    "css",
                    "html",
                    "xml",
                    "javascript",
                    "json",
                    "jsx",
                    "sass",
                    "typescript",
                    "c",
                    "cpp",
                    "csharp",
                    "groovy",
                    "php",
                    "ruby",
                    "fortran",
                    "plsql",
                    "scala",
                    "objectivec",
                    "perl",
                    "swift",
                    "python",
                    "java",
                    "pug"
                ]
            }
        },
        "extensions": {
            "type": "array",
            "description": "Common file extensions parsed by engine",
            "items": {
                "type": "string"
            }
        },
        "configs": {
            "type": "array",
            "description": "List of file names which could be treated as engine config",
            "items": {
                "type": "string"
            }
        },
        "license": {
            "type": "string",
            "description": "The engine license",
            "enum": [
                "Unknown",
                "AGPL-3.0",
                "Apache-2.0",
                "MIT",
                "ISC"
            ]
        },
        "requirements": {
            "type": "array",
            "description": "The engine requirements",
            "items": {
                "$ref": "#/definitions/requirement"
            }
        },
        "areas": {
            "type": "array",
            "description": "The engine areas",
            "items": {
                "type": "string",
                "enum": [
                    "code simplification",
                    "commented code",
                    "complexity",
                    "documentation",
                    "duplication",
                    "formatting",
                    "grammar",
                    "memory leak",
                    "security",
                    "simplification",
                    "smell",
                    "spelling",
                    "syntax",
                    "undefined element",
                    "unreachable code",
                    "unused code"
                ]
            }
        },
        "acceptMask": {
            "type": "boolean",
            "description": "Can use masks for multiple files analyze",
            "default": true
        },
        "output": {
            "type": "string",
            "description": "The engine output format",
            "enum": [
                "json",
                "xml"
            ],
            "default": "json"
        },
        "postfix": {
            "type": "string",
            "description": "Posstfix in terminal (normaly post processor)"
        },
        "optionsDelimiter": {
            "type": "string",
            "description": "Delimiter for options (space by default)",
            "default": " "
        },
        "successCode": {
            "type": "integer",
            "description": "Success exit code"
        },
        "active": {
            "type": "boolean",
            "description": "A value indicating whether engine is active",
            "default": true
        },
        "defaults": {
            "type": "object",
            "description": "The default configuration of engine. This property is specific for each engine"
        },
        "stdin": {
            "type": "object",
            "description": "The stdin configuration of engine. This property is specific for each engine. Must be an empty object, if engine needs no params, but supports stdin"
        }
    },
    "required": [
        "name",
        "description",
        "languages",
        "license",
        "areas"
    ],
    "definitions": {
        "requirement": {
            "type": "object",
            "description": "The engine dependency",
            "properties": {
                "manager": {
                    "type": "string",
                    "description": "The manager for dependency",
                    "enum": [
                        "system",
                        "url",
                        "composer",
                        "gem",
                        "npm",
                        "pip"
                    ]
                },
                "package": {
                    "type": "string",
                    "description": "The package name"
                },
                "version": {
                    "type": "string",
                    "description": "The package version"
                }
            }
        }
    }
}