Skip to content

Commit

Permalink
chore: change all rules severity to error in the all ruleset
Browse files Browse the repository at this point in the history
  • Loading branch information
tatomyr committed Oct 24, 2023
1 parent 1d3244f commit 0cd3e81
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
env:
CI: true

# FIXME: fix this so the `cli` package includes the corresponding `core`
cli-package-test:
runs-on: ubuntu-latest
steps:
Expand Down
52 changes: 47 additions & 5 deletions __tests__/lint/turn-on-all-rules/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,21 @@ Path parameter \`test_id\` is not used in the path \`/ping/{id}/{test}\`.
Error was generated by the path-parameters-defined rule.
[8] openapi.yaml:17:7 at #/paths/~1ping~1{id}~1{test}/get/responses
[8] openapi.yaml:12:17 at #/paths/~1ping~1{id}~1{test}/get/parameters/0/name
Path parameter \`test_id\` is not used in the path \`/ping/{id}/{test}\`.
10 | parameters:
11 | - in: path
12 | name: test_id
| ^^^^^^^
13 | description: User id
14 | required: true
Error was generated by the path-params-defined rule.
[9] openapi.yaml:17:7 at #/paths/~1ping~1{id}~1{test}/get/responses
Operation must have at least one \`4XX\` response.
Expand All @@ -111,7 +125,7 @@ Operation must have at least one \`4XX\` response.
Error was generated by the operation-4xx-response rule.
[9] openapi.yaml:10:7 at #/paths/~1ping~1{id}~1{test}/get/parameters
[10] openapi.yaml:10:7 at #/paths/~1ping~1{id}~1{test}/get/parameters
The operation does not define the path parameter \`{id}\` expected by path \`/ping/{id}/{test}\`.
Expand All @@ -125,7 +139,7 @@ The operation does not define the path parameter \`{id}\` expected by path \`/pi
Error was generated by the path-parameters-defined rule.
[10] openapi.yaml:10:7 at #/paths/~1ping~1{id}~1{test}/get/parameters
[11] openapi.yaml:10:7 at #/paths/~1ping~1{id}~1{test}/get/parameters
The operation does not define the path parameter \`{test}\` expected by path \`/ping/{id}/{test}\`.
Expand All @@ -139,7 +153,35 @@ The operation does not define the path parameter \`{test}\` expected by path \`/
Error was generated by the path-parameters-defined rule.
[11] openapi.yaml:8:3 at #/paths/~1ping~1{id}~1{test}
[12] openapi.yaml:10:7 at #/paths/~1ping~1{id}~1{test}/get/parameters
The operation does not define the path parameter \`{id}\` expected by path \`/ping/{id}/{test}\`.
8 | '/ping/{id}/{test}':
9 | get:
10 | parameters:
| ^^^^^^^^^^
11 | - in: path
12 | name: test_id
Error was generated by the path-params-defined rule.
[13] openapi.yaml:10:7 at #/paths/~1ping~1{id}~1{test}/get/parameters
The operation does not define the path parameter \`{test}\` expected by path \`/ping/{id}/{test}\`.
8 | '/ping/{id}/{test}':
9 | get:
10 | parameters:
| ^^^^^^^^^^
11 | - in: path
12 | name: test_id
Error was generated by the path-params-defined rule.
[14] openapi.yaml:8:3 at #/paths/~1ping~1{id}~1{test}
path segment \`ping\` should be plural.
Expand All @@ -155,7 +197,7 @@ Error was generated by the path-segment-plural rule.
/openapi.yaml: validated in <test>ms
❌ Validation failed with 11 errors.
❌ Validation failed with 14 errors.
run \`redocly lint --generate-ignore-file\` to add all problems to the ignore file.
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/fetch-with-timeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async (url: string, options = {}) => {
controller.abort();
}, TIMEOUT);

// FIXME: fix this
// FIXME: fix this (possibly along with this issue: https://github.com/Redocly/redocly-cli/issues/1260)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const res = await nodeFetch(url, { signal: controller.signal, ...options });
Expand Down
18 changes: 9 additions & 9 deletions packages/core/src/config/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const all: PluginStyleguideConfig<'built-in'> = {
'no-invalid-parameter-examples': 'error',
'scalar-property-missing-example': 'error',
'spec-strict-refs': 'error',
'path-http-verbs-order': 'off',
'path-params-defined': 'off',
'required-string-property-missing-min-length': 'off',
'response-contains-header': 'off',
'path-http-verbs-order': 'error',
'path-params-defined': 'error',
'required-string-property-missing-min-length': 'error',
'response-contains-header': 'error',
},
oas2Rules: {
'boolean-parameter-prefixes': 'error',
Expand All @@ -54,7 +54,7 @@ const all: PluginStyleguideConfig<'built-in'> = {
severity: 'error',
allowedValues: ['application/json'],
},
'response-contains-property': 'off',
'response-contains-property': 'error',
},
oas3_0Rules: {
'no-invalid-media-type-examples': 'error',
Expand All @@ -76,8 +76,8 @@ const all: PluginStyleguideConfig<'built-in'> = {
allowedValues: ['application/json'],
},
'component-name-unique': 'error',
'response-contains-property': 'off',
'spec-components-invalid-map-name': 'off',
'response-contains-property': 'error',
'spec-components-invalid-map-name': 'error',
},
oas3_1Rules: {
'no-invalid-media-type-examples': 'error',
Expand All @@ -99,8 +99,8 @@ const all: PluginStyleguideConfig<'built-in'> = {
allowedValues: ['application/json'],
},
'component-name-unique': 'error',
'response-contains-property': 'off',
'spec-components-invalid-map-name': 'off',
'response-contains-property': 'error',
'spec-components-invalid-map-name': 'error',
},
};

Expand Down

0 comments on commit 0cd3e81

Please sign in to comment.