From 8c0d5fb16ce0434f993e2c317d33e84ab59c87e0 Mon Sep 17 00:00:00 2001 From: Amelia Shin Date: Mon, 17 Feb 2025 16:01:29 +0900 Subject: [PATCH 1/2] Require type for oneOf mutual exclusion --- jsonschema/golangci.jsonschema.json | 3 ++- jsonschema/golangci.next.jsonschema.json | 3 ++- test/testdata/configs/custom_linter_goplugin.yml | 8 ++++++++ test/testdata/configs/custom_linter_module.yml | 7 +++++++ test/testdata/configs/custom_linter_notype.yml | 9 +++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 test/testdata/configs/custom_linter_goplugin.yml create mode 100644 test/testdata/configs/custom_linter_module.yml create mode 100644 test/testdata/configs/custom_linter_notype.yml diff --git a/jsonschema/golangci.jsonschema.json b/jsonschema/golangci.jsonschema.json index 3716dc8258a7..949ee500d26a 100644 --- a/jsonschema/golangci.jsonschema.json +++ b/jsonschema/golangci.jsonschema.json @@ -3846,7 +3846,8 @@ { "properties": { "type": {"enum": ["module"] } - } + }, + "required": ["type"] }, { "required": ["path"] diff --git a/jsonschema/golangci.next.jsonschema.json b/jsonschema/golangci.next.jsonschema.json index 3716dc8258a7..949ee500d26a 100644 --- a/jsonschema/golangci.next.jsonschema.json +++ b/jsonschema/golangci.next.jsonschema.json @@ -3846,7 +3846,8 @@ { "properties": { "type": {"enum": ["module"] } - } + }, + "required": ["type"] }, { "required": ["path"] diff --git a/test/testdata/configs/custom_linter_goplugin.yml b/test/testdata/configs/custom_linter_goplugin.yml new file mode 100644 index 000000000000..d0af4485d0c6 --- /dev/null +++ b/test/testdata/configs/custom_linter_goplugin.yml @@ -0,0 +1,8 @@ +linters-settings: + custom: + foo: + type: "goplugin" + path: "bin/linter/myplugin.so" + description: I am a Go plugin system-based custom linter. + settings: + message: hello diff --git a/test/testdata/configs/custom_linter_module.yml b/test/testdata/configs/custom_linter_module.yml new file mode 100644 index 000000000000..4b816ae8e1f5 --- /dev/null +++ b/test/testdata/configs/custom_linter_module.yml @@ -0,0 +1,7 @@ +linters-settings: + custom: + foo: + type: "module" + description: I am a module-based custom linter. + settings: + message: hello diff --git a/test/testdata/configs/custom_linter_notype.yml b/test/testdata/configs/custom_linter_notype.yml new file mode 100644 index 000000000000..fc8fba196896 --- /dev/null +++ b/test/testdata/configs/custom_linter_notype.yml @@ -0,0 +1,9 @@ +linters-settings: + custom: + foo: + path: "bin/linter/myplugin.so" + description: > + I didn't specify the type, so I am a Go plugin system-based custom linter. + As such, I need to be specified the path. + settings: + message: hello From b1c2391b83fd7e2624a6f4c2b84c3ce1890c22b9 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 17 Feb 2025 13:31:38 +0100 Subject: [PATCH 2/2] review --- jsonschema/golangci.v1.57.jsonschema.json | 3 ++- jsonschema/golangci.v1.58.jsonschema.json | 3 ++- jsonschema/golangci.v1.59.jsonschema.json | 3 ++- jsonschema/golangci.v1.60.jsonschema.json | 3 ++- jsonschema/golangci.v1.61.jsonschema.json | 3 ++- jsonschema/golangci.v1.62.jsonschema.json | 3 ++- jsonschema/golangci.v1.63.jsonschema.json | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/jsonschema/golangci.v1.57.jsonschema.json b/jsonschema/golangci.v1.57.jsonschema.json index 6e72616e8367..c3a3cb899455 100644 --- a/jsonschema/golangci.v1.57.jsonschema.json +++ b/jsonschema/golangci.v1.57.jsonschema.json @@ -3198,7 +3198,8 @@ { "properties": { "type": {"enum": ["module"] } - } + }, + "required": ["type"] }, { "required": ["path"] diff --git a/jsonschema/golangci.v1.58.jsonschema.json b/jsonschema/golangci.v1.58.jsonschema.json index db22554c1a16..3f1fc7ec24c5 100644 --- a/jsonschema/golangci.v1.58.jsonschema.json +++ b/jsonschema/golangci.v1.58.jsonschema.json @@ -3356,7 +3356,8 @@ { "properties": { "type": {"enum": ["module"] } - } + }, + "required": ["type"] }, { "required": ["path"] diff --git a/jsonschema/golangci.v1.59.jsonschema.json b/jsonschema/golangci.v1.59.jsonschema.json index 66b2cc742a6d..384eb702366c 100644 --- a/jsonschema/golangci.v1.59.jsonschema.json +++ b/jsonschema/golangci.v1.59.jsonschema.json @@ -3484,7 +3484,8 @@ { "properties": { "type": {"enum": ["module"] } - } + }, + "required": ["type"] }, { "required": ["path"] diff --git a/jsonschema/golangci.v1.60.jsonschema.json b/jsonschema/golangci.v1.60.jsonschema.json index f8233a77759d..0c3014180f11 100644 --- a/jsonschema/golangci.v1.60.jsonschema.json +++ b/jsonschema/golangci.v1.60.jsonschema.json @@ -3510,7 +3510,8 @@ { "properties": { "type": {"enum": ["module"] } - } + }, + "required": ["type"] }, { "required": ["path"] diff --git a/jsonschema/golangci.v1.61.jsonschema.json b/jsonschema/golangci.v1.61.jsonschema.json index 88c6eec6ef0b..34c6faafd1bf 100644 --- a/jsonschema/golangci.v1.61.jsonschema.json +++ b/jsonschema/golangci.v1.61.jsonschema.json @@ -3515,7 +3515,8 @@ { "properties": { "type": {"enum": ["module"] } - } + }, + "required": ["type"] }, { "required": ["path"] diff --git a/jsonschema/golangci.v1.62.jsonschema.json b/jsonschema/golangci.v1.62.jsonschema.json index e7c261b8b0dd..cefecd0b45e8 100644 --- a/jsonschema/golangci.v1.62.jsonschema.json +++ b/jsonschema/golangci.v1.62.jsonschema.json @@ -3578,7 +3578,8 @@ { "properties": { "type": {"enum": ["module"] } - } + }, + "required": ["type"] }, { "required": ["path"] diff --git a/jsonschema/golangci.v1.63.jsonschema.json b/jsonschema/golangci.v1.63.jsonschema.json index 4d94d0674f65..5bbe35fb8d9d 100644 --- a/jsonschema/golangci.v1.63.jsonschema.json +++ b/jsonschema/golangci.v1.63.jsonschema.json @@ -3795,7 +3795,8 @@ { "properties": { "type": {"enum": ["module"] } - } + }, + "required": ["type"] }, { "required": ["path"]