From bf168163221a27b46dd304d79b71b8ea6bfc928a Mon Sep 17 00:00:00 2001 From: Gasper Urh Date: Wed, 19 Feb 2025 18:05:36 +0100 Subject: [PATCH 1/3] support comment directives for revive linter --- .golangci.next.reference.yml | 6 ++++++ jsonschema/golangci.jsonschema.json | 26 +++++++++++++++++++++++ jsonschema/golangci.next.jsonschema.json | 26 +++++++++++++++++++++++ jsonschema/golangci.v1.57.jsonschema.json | 26 +++++++++++++++++++++++ jsonschema/golangci.v1.58.jsonschema.json | 26 +++++++++++++++++++++++ jsonschema/golangci.v1.59.jsonschema.json | 26 +++++++++++++++++++++++ jsonschema/golangci.v1.60.jsonschema.json | 26 +++++++++++++++++++++++ jsonschema/golangci.v1.61.jsonschema.json | 26 +++++++++++++++++++++++ jsonschema/golangci.v1.62.jsonschema.json | 26 +++++++++++++++++++++++ jsonschema/golangci.v1.63.jsonschema.json | 26 +++++++++++++++++++++++ 10 files changed, 240 insertions(+) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index 05fddf8419a9..4162411fe4ff 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -2386,6 +2386,12 @@ linters-settings: # Default: false enable-all-rules: true + # Enable validation of comment directives + # See https://github.com/mgechev/revive#comment-directives + directives: + - name: specify-disable-reason + severity: error + # Sets the default failure confidence. # This means that linting errors with less than 0.8 confidence will be ignored. # Default: 0.8 diff --git a/jsonschema/golangci.jsonschema.json b/jsonschema/golangci.jsonschema.json index 949ee500d26a..b52a2f532dc8 100644 --- a/jsonschema/golangci.jsonschema.json +++ b/jsonschema/golangci.jsonschema.json @@ -2657,6 +2657,32 @@ "type": "boolean", "default": false }, + "directives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "enum": ["specify-disable-reason"] + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + }, "rules": { "type": "array", "items": { diff --git a/jsonschema/golangci.next.jsonschema.json b/jsonschema/golangci.next.jsonschema.json index 949ee500d26a..b52a2f532dc8 100644 --- a/jsonschema/golangci.next.jsonschema.json +++ b/jsonschema/golangci.next.jsonschema.json @@ -2657,6 +2657,32 @@ "type": "boolean", "default": false }, + "directives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "enum": ["specify-disable-reason"] + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + }, "rules": { "type": "array", "items": { diff --git a/jsonschema/golangci.v1.57.jsonschema.json b/jsonschema/golangci.v1.57.jsonschema.json index c3a3cb899455..8ef0588837f9 100644 --- a/jsonschema/golangci.v1.57.jsonschema.json +++ b/jsonschema/golangci.v1.57.jsonschema.json @@ -2209,6 +2209,32 @@ "type": "boolean", "default": false }, + "directives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "enum": ["specify-disable-reason"] + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + }, "rules": { "type": "array", "items": { diff --git a/jsonschema/golangci.v1.58.jsonschema.json b/jsonschema/golangci.v1.58.jsonschema.json index 3f1fc7ec24c5..d7f790cdcca6 100644 --- a/jsonschema/golangci.v1.58.jsonschema.json +++ b/jsonschema/golangci.v1.58.jsonschema.json @@ -2380,6 +2380,32 @@ "type": "boolean", "default": false }, + "directives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "enum": ["specify-disable-reason"] + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + }, "rules": { "type": "array", "items": { diff --git a/jsonschema/golangci.v1.59.jsonschema.json b/jsonschema/golangci.v1.59.jsonschema.json index 384eb702366c..d1ef23834332 100644 --- a/jsonschema/golangci.v1.59.jsonschema.json +++ b/jsonschema/golangci.v1.59.jsonschema.json @@ -2463,6 +2463,32 @@ "type": "boolean", "default": false }, + "directives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "enum": ["specify-disable-reason"] + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + }, "rules": { "type": "array", "items": { diff --git a/jsonschema/golangci.v1.60.jsonschema.json b/jsonschema/golangci.v1.60.jsonschema.json index 0c3014180f11..087ad65b89cb 100644 --- a/jsonschema/golangci.v1.60.jsonschema.json +++ b/jsonschema/golangci.v1.60.jsonschema.json @@ -2469,6 +2469,32 @@ "type": "boolean", "default": false }, + "directives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "enum": ["specify-disable-reason"] + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + }, "rules": { "type": "array", "items": { diff --git a/jsonschema/golangci.v1.61.jsonschema.json b/jsonschema/golangci.v1.61.jsonschema.json index 34c6faafd1bf..18bd56fbea14 100644 --- a/jsonschema/golangci.v1.61.jsonschema.json +++ b/jsonschema/golangci.v1.61.jsonschema.json @@ -2474,6 +2474,32 @@ "type": "boolean", "default": false }, + "directives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "enum": ["specify-disable-reason"] + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + }, "rules": { "type": "array", "items": { diff --git a/jsonschema/golangci.v1.62.jsonschema.json b/jsonschema/golangci.v1.62.jsonschema.json index cefecd0b45e8..2e93a2fc5403 100644 --- a/jsonschema/golangci.v1.62.jsonschema.json +++ b/jsonschema/golangci.v1.62.jsonschema.json @@ -2528,6 +2528,32 @@ "type": "boolean", "default": false }, + "directives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "enum": ["specify-disable-reason"] + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + }, "rules": { "type": "array", "items": { diff --git a/jsonschema/golangci.v1.63.jsonschema.json b/jsonschema/golangci.v1.63.jsonschema.json index 5bbe35fb8d9d..a5992b16c740 100644 --- a/jsonschema/golangci.v1.63.jsonschema.json +++ b/jsonschema/golangci.v1.63.jsonschema.json @@ -2606,6 +2606,32 @@ "type": "boolean", "default": false }, + "directives": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "enum": ["specify-disable-reason"] + }, + "severity": { + "type": "string", + "enum": ["warning", "error"] + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "arguments": { + "type": "array" + } + } + } + }, "rules": { "type": "array", "items": { From a77ee8466ada13eceabb68a3bbbe38d112fd495d Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 19 Feb 2025 18:23:58 +0100 Subject: [PATCH 2/3] review --- .golangci.reference.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 1912a5bd6500..2d53f2010a10 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -2386,6 +2386,12 @@ linters-settings: # Default: false enable-all-rules: true + # Enable validation of comment directives + # See https://github.com/mgechev/revive#comment-directives + directives: + - name: specify-disable-reason + severity: error + # Sets the default failure confidence. # This means that linting errors with less than 0.8 confidence will be ignored. # Default: 0.8 From 95626e28a1d5ec50d7f7b4ac782876365902fc1b Mon Sep 17 00:00:00 2001 From: Gasper Urh Date: Wed, 19 Feb 2025 18:59:19 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Add dot at the end of descriptions Co-authored-by: Oleksandr Redko --- .golangci.next.reference.yml | 2 +- .golangci.reference.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index 4162411fe4ff..2bf475896288 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -2386,7 +2386,7 @@ linters-settings: # Default: false enable-all-rules: true - # Enable validation of comment directives + # Enable validation of comment directives. # See https://github.com/mgechev/revive#comment-directives directives: - name: specify-disable-reason diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 2d53f2010a10..191224c6dab3 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -2386,7 +2386,7 @@ linters-settings: # Default: false enable-all-rules: true - # Enable validation of comment directives + # Enable validation of comment directives. # See https://github.com/mgechev/revive#comment-directives directives: - name: specify-disable-reason