Skip to content

Commit

Permalink
Turn on yml/indent.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Jun 6, 2024
1 parent ceb06e2 commit a03f38f
Show file tree
Hide file tree
Showing 21 changed files with 168 additions and 167 deletions.
2 changes: 1 addition & 1 deletion .github/opensearch-cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ services:
- "9200:9200"
- "9600:9600"
environment:
- "discovery.type=single-node"
- discovery.type=single-node
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!}"
4 changes: 1 addition & 3 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Check Links

on:
push:
pull_request:
on: [push, pull_request]

jobs:
check:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main

concurrency:
group: "pages"
group: pages
cancel-in-progress: false

permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
COMMENT_IDENTIFIER=$(jq -r '.comment_identifier' ./pr-comment.json)
TEMPLATE_NAME=$(jq -r '.template_name' ./pr-comment.json)
TEMPLATE_DATA=$(jq -c '.template_data' ./pr-comment.json)
vars=(
PR_NUMBER
COMMENT_IDENTIFIER
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ name: Test Spec

on:
push:
branches: [ '**' ]
paths:
- 'package*.json'
- 'tsconfig.json'
- 'tools/src/tester/**'
- 'spec/**'
branches: ['**']
paths:
- 'package*.json'
- tsconfig.json
- 'tools/src/tester/**'
- 'spec/**'
pull_request:
branches: [ '**' ]
paths:
- 'package*.json'
- 'tsconfig.json'
- 'tools/src/tester/**'
- 'spec/**'
branches: ['**']
paths:
- 'package*.json'
- tsconfig.json
- 'tools/src/tester/**'
- 'spec/**'

jobs:
test-opensearch-spec:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ on:
branches: ['**']
paths:
- 'package*.json'
- 'eslint.config.mjs'
- 'jest.config.js'
- 'tsconfig.json'
- eslint.config.mjs
- jest.config.js
- tsconfig.json
- 'tools/**'
pull_request:
branches: ['**']
paths:
- 'package*.json'
- 'eslint.config.mjs'
- 'jest.config.js'
- 'tsconfig.json'
- eslint.config.mjs
- jest.config.js
- tsconfig.json
- 'tools/**'

jobs:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added API coverage ([#210](https://github.com/opensearch-project/opensearch-api-specification/pull/210))
- Added license headers to TypeScript code ([#311](https://github.com/opensearch-project/opensearch-api-specification/pull/311))
- Added `npm run test:spec -- --dry-run --verbose` ([#303](https://github.com/opensearch-project/opensearch-api-specification/pull/303))

- Added a YAML linter ([#312](https://github.com/opensearch-project/opensearch-api-specification/pull/312))

### Changed

- Replaced Smithy with a native OpenAPI spec ([#189](https://github.com/opensearch-project/opensearch-api-specification/issues/189))
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ npm run test -- tools/tests/tester/

#### Lints

All code is linted using [ESLint](https://eslint.org/) in combination with [typescript-eslint](https://typescript-eslint.io/). Linting can be run via:
All TypeScript code and YAML files are linted using [ESLint](https://eslint.org/), [typescript-eslint](https://typescript-eslint.io/), and [eslint-plugin-yml](https://ota-meshi.github.io/eslint-plugin-yml/). Linting can be run via:
```bash
npm run lint
```
Expand Down
4 changes: 3 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default [
'new-cap': 'off',
'no-return-assign': 'error',
'object-shorthand': 'error',
'no-constant-condition': 'off',
'license-header/header': [
'error',
[
Expand All @@ -98,7 +99,8 @@ export default [
},
rules: {
'yml/no-empty-document': 'off',
'yml/quotes': ['error', { prefer: 'single' }]
'yml/quotes': 'off',
'yml/plain-scalar': 'off'
}
}
]
16 changes: 8 additions & 8 deletions json_schemas/test_story.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ properties:
items:
$ref: '#/definitions/Chapter'
minItems: 1
required: [ description, chapters]
required: [description, chapters]
additionalProperties: false

definitions:
Expand All @@ -37,7 +37,7 @@ definitions:
description: A brief description of the chapter.
response:
$ref: '#/definitions/ExpectedResponse'
required: [ synopsis ]
required: [synopsis]
additionalProperties: false

ReadChapter:
Expand All @@ -47,7 +47,7 @@ definitions:
properties:
response:
$ref: '#/definitions/ActualResponse'
required: [ response ]
required: [response]
additionalProperties: false

SupplementalChapter:
Expand All @@ -70,14 +70,14 @@ definitions:
type: string
method:
type: string
enum: [ GET, PUT, POST, DELETE, PATCH, HEAD, OPTIONS ]
enum: [GET, PUT, POST, DELETE, PATCH, HEAD, OPTIONS]
parameters:
type: object
additionalProperties:
$ref: '#/definitions/Parameter'
request_body:
$ref: '#/definitions/RequestBody'
required: [ path, method ]
required: [path, method]
additionalProperties: false


Expand All @@ -89,7 +89,7 @@ definitions:
default: application/json
payload:
$ref: '#/definitions/Payload'
required: [ payload ]
required: [payload]
additionalProperties: false

ExpectedResponse:
Expand All @@ -104,7 +104,7 @@ definitions:
default: application/json
payload:
$ref: '#/definitions/Payload'
required: [ status ]
required: [status]
additionalProperties: false

ActualResponse:
Expand All @@ -122,7 +122,7 @@ definitions:
error:
type: object
description: Error object.
required: [ status, content_type, payload ]
required: [status, content_type, payload]
additionalProperties: false

Payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,31 @@ paths:
'200':
$ref: '#/components/responses/adopt@200'
components:
requestBodies:
adopt: {
content: {
application/json: {
schema: {
type: object2
}
}
}
}
parameters:
adopt::path.animal:
name: animal
in: path
schema:
$ref: '../schemas/animals.yaml#/components/schemas/Animal'
adopt::path.docket:
name: docket
in: path
schema:
type: number2
responses:
adopt@200:
description: ''
content:
application/json:
schema:
type: object2
requestBodies:
adopt:
content:
application/json:
schema:
type: object2




parameters:
adopt::path.animal:
name: animal
in: path
schema:
$ref: '../schemas/animals.yaml#/components/schemas/Animal'
adopt::path.docket:
name: docket
in: path
schema:
type: number2
responses:
adopt@200:
description: ''
content:
application/json:
schema:
type: object2
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ info:
description: OpenSearch API
version: 1.0.0
components:
schemas:
Bark:
type: string
Meow:
type: string
schemas:
Bark:
type: string
Meow:
type: string
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ components:
- $ref: '#/components/schemas/Dog'
- $ref: '#/components/schemas/Cat'
Dog:
type: object
properties:
bark:
$ref: 'actions.yaml#/components/schemas/Bark'
type: object
properties:
bark:
$ref: 'actions.yaml#/components/schemas/Bark'
Cat:
type: object
properties:
meow:
$ref: 'actions.yaml#/components/schemas/Meow'
type: object
properties:
meow:
$ref: 'actions.yaml#/components/schemas/Meow'
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ paths:
'200':
$ref: '#/components/responses/adopt@200'
components:
requestBodies:
adopt: {}
parameters:
adopt::path.animal:
name: animal
in: path
requestBodies:
adopt: {}
parameters:
adopt::path.animal:
name: animal
in: path
schema:
$ref: '../schemas/animals.yaml#/components/schemas/Animal'
adopt::path.docket:
name: docket
in: path
schema:
type: number
responses:
adopt@200:
description: ''
application/json:
schema:
$ref: '../schemas/animals.yaml#/components/schemas/Animal'
adopt::path.docket:
name: docket
in: path
schema:
type: number
responses:
adopt@200:
description: ''
application/json:
schema:
type: object
type: object
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ info:
description: OpenSearch API
version: 1.0.0
components:
schemas:
Bark:
type: bogus
Meow:
type: string
schemas:
Bark:
type: bogus
Meow:
type: string
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ components:
- $ref: '#/components/schemas/Dog'
- $ref: '#/components/schemas/Cat'
Dog:
type: bogus
properties:
bark:
$ref: 'actions.yaml#/components/schemas/Bark'
type: bogus
properties:
bark:
$ref: 'actions.yaml#/components/schemas/Bark'
Cat:
type: object
properties:
meow:
$ref: 'actions.yaml#/components/schemas/Meow'
type: object
properties:
meow:
$ref: 'actions.yaml#/components/schemas/Meow'
Loading

0 comments on commit a03f38f

Please sign in to comment.