Skip to content

Commit

Permalink
adding linters for OpenAPI samples closes #2831
Browse files Browse the repository at this point in the history
Signed-off-by: Rogério Peixoto <[email protected]>
  • Loading branch information
rogeriopeixotocx committed Apr 14, 2021
1 parent f4ec211 commit cc6d637
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 4 deletions.
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/validate-ansible-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
uses: ibiqlik/action-yamllint@v3
with:
file_or_dir: assets/queries/ansible/
config_file: .github/yamllint.yml
config_file: .github/yamllint_ansible.yml
strict: true
45 changes: 45 additions & 0 deletions .github/workflows/validate-openapi-samples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: validate-openapi-samples

on:
pull_request:
paths:
- "assets/queries/openapi/**/test/*.yaml"
- "assets/queries/openapi/**/test/*.json"

jobs:
lint-yaml-samples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
file_or_dir: assets/queries/openAPI/
config_file: .github/yamllint.yml
strict: true
lint-json-samples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Installing jsonlint
run: |
npm install -g jsonlint
npm show jsonlint
which jsonlint
- name: Running JSON lint
run: |
python3 -u ".github/validators/validate-syntax.py" \
"assets/queries/openapi/**/test/*.json" \
--linter jsonlint \
--skip ".github/validators/openapi-skip-list" -vv
2 changes: 0 additions & 2 deletions .github/yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ rules:
indentation:
indent-sequences: consistent
comments-indentation: disable
ignore: |
**/kms_key_with_vulnerable_policy/test/positive.yaml
10 changes: 10 additions & 0 deletions .github/yamllint_ansible.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends: relaxed
rules:
line-length:
max: 180
level: warning
indentation:
indent-sequences: consistent
comments-indentation: disable
ignore: |
**/kms_key_with_vulnerable_policy/test/positive.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.0",
"info": {
"title": "Simple API overview",
"title": "Simple API Overview",
"version": "1.0.0"
},
"paths": {
Expand Down

0 comments on commit cc6d637

Please sign in to comment.