From 6ef2c02aa4b199ad303d46d2037832e7512e6851 Mon Sep 17 00:00:00 2001 From: Siddharth Sharma Date: Tue, 12 Mar 2024 08:29:33 +0100 Subject: [PATCH] Limit bad-include/import-yang-version setting Based on discussion in TypeFox/yang-vscode#40 bad-include-yang-version and bad-import-yang-version are not configurable. Also updated Settings.md documentation to clarify. Signed-off-by: Siddharth Sharma --- docs/Settings.md | 4 ++-- schema/yang-lsp-settings-schema.json | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/Settings.md b/docs/Settings.md index 1ff5563..3e5dbf9 100644 --- a/docs/Settings.md +++ b/docs/Settings.md @@ -150,13 +150,13 @@ For instance; the name contains any invalid characters, or equals to any YANG bu Issues code when there is an inconsistency between a module's version and the version of the included modules. - (default severity: error) + (fixed severity: error) #### `bad-import-yang-version` Issues code when there is an inconsistency between a module's version and the version of the included modules. - (default severity: error) + (fixed severity: error) #### `duplicate-enumerable-name` diff --git a/schema/yang-lsp-settings-schema.json b/schema/yang-lsp-settings-schema.json index f4923eb..78475f0 100644 --- a/schema/yang-lsp-settings-schema.json +++ b/schema/yang-lsp-settings-schema.json @@ -1,5 +1,5 @@ { - "$id": "https://github.com/TypeFox/yang-lsp/schema/yang-lsp-settings-schema.json", + "$id": "https://github.com/TypeFox/yang-lsp/blob/master/schema/yang-lsp-settings-schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "YANG LSP Settings JSON Schema", "description": "JSON Schema for YANG LSP settings file 'yang.settings'.\nSee https://github.com/TypeFox/yang-lsp/blob/master/docs/Settings.md", @@ -54,6 +54,11 @@ "warning", "ignore" ] + }, + "fixed-severity": { + "enum": [ + "error" + ] } }, "properties": { @@ -124,12 +129,12 @@ }, "bad-include-yang-version": { "description": "Issues code when there is an inconsistency between a module's yang-version and the yang-version of the included modules.", - "$ref": "#/properties/diagnostic/$defs/severity", + "$ref": "#/properties/diagnostic/$defs/fixed-severity", "default": "error" }, "bad-import-yang-version": { "description": "Issues code when there is an inconsistency between a module's yang-version and the yang-version of the imported modules.", - "$ref": "#/properties/diagnostic/$defs/severity", + "$ref": "#/properties/diagnostic/$defs/fixed-severity", "default": "error" }, "duplicate-enumerable-name": {