From ae68bc8c8a234a5941d2c65586b9d9ec68908695 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 24 Nov 2017 11:22:14 -0800 Subject: [PATCH] Add schema support for conda's environment.yml files --- package.json | 12 +++++++++++ schemas/conda-environment.json | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 schemas/conda-environment.json diff --git a/package.json b/package.json index 7602332878cd..7adc226ec26c 100644 --- a/package.json +++ b/package.json @@ -1519,6 +1519,18 @@ "scopeName": "source.pip-requirements", "path": "./syntaxes/pip-requirements.tmLanguage.json" } + ], + "jsonValidation": [ + { + "fileMatch": "environment.yml", + "url": "./schemas/conda-environment.json" + } + ], + "yamlValidation": [ + { + "fileMatch": "environment.yml", + "url": "./schemas/conda-environment.json" + } ] }, "scripts": { diff --git a/schemas/conda-environment.json b/schemas/conda-environment.json new file mode 100644 index 000000000000..9208fc685924 --- /dev/null +++ b/schemas/conda-environment.json @@ -0,0 +1,37 @@ +{ + "title": "conda environment file", + "description": "Support for conda's enviroment.yml files (e.g. `conda env export > environment.yml`)", + "id": "https://raw.githubusercontent.com/Microsoft/vscode-python/master/schemas/conda-environment.json", + "$schema": "http://json-schema.org/draft-04/schema#", + "definitions": { + "channel": { + "type": "string" + }, + "package": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "properties": { + "name": { + "type": "string" + }, + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/channel" + } + }, + "dependencies": { + "type": "array", + "items": { + "$ref": "#/definitions/package" + } + }, + "prefix": { + "$ref": "#/definitions/path" + } + } +}