Skip to content

Commit

Permalink
Turned on some more YAML lints. (#413)
Browse files Browse the repository at this point in the history
* Turn on yml/plain-scalar.

Signed-off-by: dblock <[email protected]>

* Turn on yml/quotes.

Signed-off-by: dblock <[email protected]>

* Turned on yml/no-trailing-zeros and yml/no-multiple-empty-lines.

Signed-off-by: dblock <[email protected]>

* Removed unnecessary spaces between { }.

Signed-off-by: dblock <[email protected]>

* Enabled yml/sort-sequence-values.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored Jul 15, 2024
1 parent 188413c commit 8779af6
Show file tree
Hide file tree
Showing 92 changed files with 619 additions and 608 deletions.
8 changes: 4 additions & 4 deletions .github/opensearch-cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ services:
opensearch-cluster:
image: ${OPENSEARCH_DOCKER_HUB_PROJECT:-opensearchproject}/opensearch:${OPENSEARCH_VERSION:-latest}
ports:
- "9200:9200"
- "9600:9600"
- '9200:9200'
- '9600:9600'
environment:
- 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!}'
- discovery.type=single-node
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!}"
- "path.repo=/tmp/opensearch/repo"
- path.repo=/tmp/opensearch/repo
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
uses: sean0x42/markdown-extract@v2
with:
file: CHANGELOG.md
pattern: 'Unreleased'
pattern: Unreleased

- name: Update Release Description
id: update
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Verify Changelog
on:
pull_request:
types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled]
types: [edited, labeled, opened, ready_for_review, reopened, review_requested, synchronize, unlabeled]

jobs:
verify-changelog:
Expand All @@ -14,4 +14,4 @@ jobs:

- uses: dangoslen/changelog-enforcer@v3
with:
skipLabels: "autocut, skip-changelog"
skipLabels: 'autocut, skip-changelog'
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Check Links

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

jobs:
check:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
push:
branches: ['**']
paths:
- '**/*.yaml'
- '**/*.ts'
- '**/*.yaml'
pull_request:
branches: ['**']
paths:
- '**/*.yaml'
- '**/*.ts'
- '**/*.yaml'

jobs:
lint:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ on:
paths:
- .github/workflows/test-spec.yml
- package*.json
- tsconfig.json
- tools/src/tester/**
- spec/**
- tools/src/tester/**
- tsconfig.json
pull_request:
paths:
- .github/workflows/test-spec.yml
- package*.json
- tsconfig.json
- tools/src/tester/**
- spec/**
- tools/src/tester/**
- tsconfig.json

jobs:
test-opensearch-spec:
strategy:
matrix:
entry:
- {version: 2.0.0, admin_password: 'admin'}
- {version: 2.0.0, admin_password: admin}
- {version: 2.15.0}
- {version: 2.16.0, hub: 'opensearchstaging'}
- {version: 2.16.0, hub: opensearchstaging}

name: test-opensearch-spec (version=${{ matrix.entry.version }}, hub=${{ matrix.entry.hub || 'opensearchproject' }})
runs-on: ubuntu-latest
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-tools-integ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ on:
push:
branches: ['**']
paths:
- 'package*.json'
- '.github/workflows/test-tools*.yml'
- eslint.config.mjs
- jest.config.js
- tsconfig.json
- 'package*.json'
- 'tools/**'
- '.github/workflows/test-tools*.yml'
- tsconfig.json
pull_request:
branches: ['**']
paths:
- 'package*.json'
- '.github/workflows/test-tools*.yml'
- eslint.config.mjs
- jest.config.js
- tsconfig.json
- 'package*.json'
- 'tools/**'
- '.github/workflows/test-tools*.yml'
- tsconfig.json

jobs:
test:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test-tools-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ on:
push:
branches: ['**']
paths:
- '.github/workflows/test-tools*.yml'
- eslint.config.mjs
- jest.config.js
- 'package*.json'
- 'eslint.config.mjs'
- 'jest.config.js'
- 'tsconfig.json'
- 'tools/**'
- '.github/workflows/test-tools*.yml'
- tsconfig.json
pull_request:
branches: ['**']
paths:
- '.github/workflows/test-tools*.yml'
- eslint.config.mjs
- jest.config.js
- 'package*.json'
- 'eslint.config.mjs'
- 'jest.config.js'
- 'tsconfig.json'
- 'tools/**'
- '.github/workflows/test-tools*.yml'
- tsconfig.json

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
source: .
destination: ./_site
include:
- index.html
- favicon.ico
- index.html
exclude:
- '*'
keep_files:
Expand Down
9 changes: 6 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ export default [
},
rules: {
'yml/no-empty-document': 'off',
'yml/quotes': 'off',
'yml/plain-scalar': 'off',
'@cspell/spellchecker': ['error', { customWordListFile: '.cspell', autoFix: true }]
'yml/quotes': ['error', { prefer: 'single', avoidEscape: true }],
'yml/plain-scalar': ['error', 'always'],
'yml/no-trailing-zeros': 'error',
'yml/no-multiple-empty-lines': 'error',
'@cspell/spellchecker': ['error', { customWordListFile: '.cspell', autoFix: true }],
'yml/sort-sequence-values': ['error', { pathPattern: '.*', order: { type: 'asc' } }]
}
}
]
3 changes: 2 additions & 1 deletion json_schemas/_superseded_operations.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ patternProperties:
type: array
items:
type: string
# eslint-disable-next-line yml/sort-sequence-values
enum: [GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH]
required: [superseded_by, operations]
required: [operations, superseded_by]
additionalProperties: false
additionalProperties: false
7 changes: 4 additions & 3 deletions json_schemas/test_story.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ properties:
$ref: '#/definitions/Chapter'
version:
$ref: '#/definitions/Version'
required: [description, chapters]
required: [chapters,description]
additionalProperties: false

definitions:
Expand Down Expand Up @@ -69,6 +69,7 @@ definitions:
type: string
method:
type: string
# eslint-disable-next-line yml/sort-sequence-values
enum: [GET, PUT, POST, DELETE, PATCH, HEAD, OPTIONS]
parameters:
type: object
Expand All @@ -80,7 +81,7 @@ definitions:
$ref: '#/definitions/Output'
version:
$ref: '#/definitions/Version'
required: [path, method]
required: [method, path]

Output:
description: |
Expand Down Expand Up @@ -140,7 +141,7 @@ definitions:
error:
type: object
description: Error object.
required: [status, content_type, payload]
required: [content_type, payload, status]
additionalProperties: false

Payload:
Expand Down
2 changes: 2 additions & 0 deletions spec/_superseded_operations.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# eslint-disable yml/sort-sequence-values

$schema: ./json_schemas/_superseded_operations.schema.yaml

/_opendistro/_alerting/destinations:
Expand Down
26 changes: 13 additions & 13 deletions spec/namespaces/_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2649,8 +2649,8 @@ components:
num_freed:
type: number
required:
- succeeded
- num_freed
- succeeded
count@200:
description: ''
content:
Expand All @@ -2663,8 +2663,8 @@ components:
_shards:
$ref: '../schemas/_common.yaml#/components/schemas/ShardStatistics'
required:
- count
- _shards
- count
create@200:
description: ''
content:
Expand Down Expand Up @@ -2792,8 +2792,8 @@ components:
get:
$ref: '../schemas/_common.yaml#/components/schemas/InlineGet'
required:
- _index
- _id
- _index
- matched
field_caps@200:
description: ''
Expand All @@ -2811,8 +2811,8 @@ components:
additionalProperties:
$ref: '../schemas/_core.field_caps.yaml#/components/schemas/FieldCapability'
required:
- indices
- fields
- indices
get@200:
description: ''
content:
Expand Down Expand Up @@ -2986,9 +2986,9 @@ components:
additionalProperties:
type: object
required:
- metric_score
- details
- failures
- metric_score
reindex@200:
description: ''
content:
Expand Down Expand Up @@ -3101,9 +3101,9 @@ components:
additionalProperties:
$ref: '../schemas/_core.search_shards.yaml#/components/schemas/ShardStoreIndex'
required:
- indices
- nodes
- shards
- indices
search_template@200:
description: ''
content:
Expand Down Expand Up @@ -3148,10 +3148,10 @@ components:
terminated_early:
type: boolean
required:
- took
- timed_out
- _shards
- hits
- timed_out
- took
termvectors@200:
description: ''
content:
Expand All @@ -3174,11 +3174,11 @@ components:
_version:
$ref: '../schemas/_common.yaml#/components/schemas/VersionNumber'
required:
- found
- _id
- _index
- took
- _version
- found
- took
update@200:
description: ''
content:
Expand Down Expand Up @@ -3994,7 +3994,7 @@ components:
description: Operation timeout for connection to cluster-manager node.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
x-version-added: 2.0.0
x-version-added: '2.0'
delete_script::query.master_timeout:
in: query
name: master_timeout
Expand Down Expand Up @@ -4458,7 +4458,7 @@ components:
description: Operation timeout for connection to cluster-manager node.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
x-version-added: 2.0.0
x-version-added: '2.0'
get_script::query.master_timeout:
in: query
name: master_timeout
Expand Down Expand Up @@ -4972,7 +4972,7 @@ components:
description: Operation timeout for connection to cluster-manager node.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
x-version-added: 2.0.0
x-version-added: '2.0'
put_script::query.master_timeout:
in: query
name: master_timeout
Expand Down
Loading

0 comments on commit 8779af6

Please sign in to comment.