Skip to content

Commit afce090

Browse files
committed
docs: add rule names validation
1 parent b3f1aba commit afce090

File tree

2 files changed

+166
-2
lines changed

2 files changed

+166
-2
lines changed

jsonschema/golangci.jsonschema.json

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,88 @@
205205
"unusedwrite"
206206
]
207207
},
208+
"revive-rules": {
209+
"enum": [
210+
"add-constant",
211+
"argument-limit",
212+
"atomic",
213+
"banned-characters",
214+
"bare-return",
215+
"blank-imports",
216+
"bool-literal-in-expr",
217+
"call-to-gc",
218+
"cognitive-complexity",
219+
"comment-spacings",
220+
"confusing-naming",
221+
"confusing-results",
222+
"constant-logical-expr",
223+
"context-as-argument",
224+
"context-keys-type",
225+
"cyclomatic",
226+
"datarace",
227+
"deep-exit",
228+
"defer",
229+
"dot-imports",
230+
"duplicated-imports",
231+
"early-return",
232+
"empty-block",
233+
"empty-lines",
234+
"enforce-map-style",
235+
"enforce-repeated-arg-type-style",
236+
"enforce-slice-style",
237+
"error-naming",
238+
"error-return",
239+
"error-strings",
240+
"errorf",
241+
"exported",
242+
"file-header",
243+
"flag-parameter",
244+
"function-length",
245+
"function-result-limit",
246+
"get-return",
247+
"identical-branches",
248+
"if-return",
249+
"import-alias-naming",
250+
"import-shadowing",
251+
"imports-blocklist",
252+
"increment-decrement",
253+
"indent-error-flow",
254+
"line-length-limit",
255+
"max-control-nesting",
256+
"max-public-structs",
257+
"modifies-parameter",
258+
"modifies-value-receiver",
259+
"nested-structs",
260+
"optimize-operands-order",
261+
"package-comments",
262+
"range",
263+
"range-val-address",
264+
"range-val-in-closure",
265+
"receiver-naming",
266+
"redefines-builtin-id",
267+
"redundant-import-alias",
268+
"string-format",
269+
"string-of-int",
270+
"struct-tag",
271+
"superfluous-else",
272+
"time-equal",
273+
"time-naming",
274+
"unchecked-type-assertion",
275+
"unconditional-recursion",
276+
"unexported-naming",
277+
"unexported-return",
278+
"unhandled-error",
279+
"unnecessary-stmt",
280+
"unreachable-code",
281+
"unused-parameter",
282+
"unused-receiver",
283+
"use-any",
284+
"useless-break",
285+
"var-declaration",
286+
"var-naming",
287+
"waitgroup-by-value"
288+
]
289+
},
208290
"linters": {
209291
"$comment": "anyOf with enum is used to allow auto completion of non-custom linters",
210292
"description": "Linters usable.",
@@ -2389,7 +2471,7 @@
23892471
"required": ["name"],
23902472
"properties": {
23912473
"name": {
2392-
"type": "string",
2474+
"$ref": "#/definitions/revive-rules",
23932475
"title": "The rule name"
23942476
},
23952477
"disabled": {

jsonschema/golangci.next.jsonschema.json

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,88 @@
205205
"unusedwrite"
206206
]
207207
},
208+
"revive-rules": {
209+
"enum": [
210+
"add-constant",
211+
"argument-limit",
212+
"atomic",
213+
"banned-characters",
214+
"bare-return",
215+
"blank-imports",
216+
"bool-literal-in-expr",
217+
"call-to-gc",
218+
"cognitive-complexity",
219+
"comment-spacings",
220+
"confusing-naming",
221+
"confusing-results",
222+
"constant-logical-expr",
223+
"context-as-argument",
224+
"context-keys-type",
225+
"cyclomatic",
226+
"datarace",
227+
"deep-exit",
228+
"defer",
229+
"dot-imports",
230+
"duplicated-imports",
231+
"early-return",
232+
"empty-block",
233+
"empty-lines",
234+
"enforce-map-style",
235+
"enforce-repeated-arg-type-style",
236+
"enforce-slice-style",
237+
"error-naming",
238+
"error-return",
239+
"error-strings",
240+
"errorf",
241+
"exported",
242+
"file-header",
243+
"flag-parameter",
244+
"function-length",
245+
"function-result-limit",
246+
"get-return",
247+
"identical-branches",
248+
"if-return",
249+
"import-alias-naming",
250+
"import-shadowing",
251+
"imports-blocklist",
252+
"increment-decrement",
253+
"indent-error-flow",
254+
"line-length-limit",
255+
"max-control-nesting",
256+
"max-public-structs",
257+
"modifies-parameter",
258+
"modifies-value-receiver",
259+
"nested-structs",
260+
"optimize-operands-order",
261+
"package-comments",
262+
"range",
263+
"range-val-address",
264+
"range-val-in-closure",
265+
"receiver-naming",
266+
"redefines-builtin-id",
267+
"redundant-import-alias",
268+
"string-format",
269+
"string-of-int",
270+
"struct-tag",
271+
"superfluous-else",
272+
"time-equal",
273+
"time-naming",
274+
"unchecked-type-assertion",
275+
"unconditional-recursion",
276+
"unexported-naming",
277+
"unexported-return",
278+
"unhandled-error",
279+
"unnecessary-stmt",
280+
"unreachable-code",
281+
"unused-parameter",
282+
"unused-receiver",
283+
"use-any",
284+
"useless-break",
285+
"var-declaration",
286+
"var-naming",
287+
"waitgroup-by-value"
288+
]
289+
},
208290
"linters": {
209291
"$comment": "anyOf with enum is used to allow auto completion of non-custom linters",
210292
"description": "Linters usable.",
@@ -2389,7 +2471,7 @@
23892471
"required": ["name"],
23902472
"properties": {
23912473
"name": {
2392-
"type": "string",
2474+
"$ref": "#/definitions/revive-rules",
23932475
"title": "The rule name"
23942476
},
23952477
"disabled": {

0 commit comments

Comments
 (0)