Skip to content

Commit

Permalink
feat: add API descriptor with API_SPECTRAL with AsyncAPI/OpenAPI support
Browse files Browse the repository at this point in the history
Add API descriptor as modified copy of the OPENAPI descriptor.
Deprecate the contained linter OPENAPI_SPECTRAL.

Add `.spectral.yaml` as default config file to `TEMPLATE/`
as modified copy of `.openapirc.yml` with rulesets for
AsyncAPI and OpenAPI (previously, only OpenAPI).

Closes: oxsecurity#3387
  • Loading branch information
pjungermann committed Apr 8, 2024
1 parent c13db37 commit 930d750
Show file tree
Hide file tree
Showing 185 changed files with 1,588 additions and 1,020 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-BETA-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
[
"action_actionlint",
"ansible_ansible_lint",
"api_spectral",
"arm_arm_ttk",
"bash_exec",
"bash_shellcheck",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-DEV-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
[
"action_actionlint",
"ansible_ansible_lint",
"api_spectral",
"arm_arm_ttk",
"bash_exec",
"bash_shellcheck",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-RELEASE-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
[
"action_actionlint",
"ansible_ansible_lint",
"api_spectral",
"arm_arm_ttk",
"bash_exec",
"bash_shellcheck",
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ WORKDIR /node-deps
RUN npm --no-cache install --ignore-scripts --omit=dev \
@salesforce/cli \
typescript \
@stoplight/spectral-cli \
@coffeelint/cli \
jscpd \
stylelint \
Expand Down Expand Up @@ -242,7 +243,6 @@ RUN npm --no-cache install --ignore-scripts --omit=dev \
markdownlint-cli \
markdown-link-check \
markdown-table-formatter \
@stoplight/spectral-cli \
secretlint \
@secretlint/secretlint-rule-preset-recommend \
@secretlint/secretlint-formatter-sarif \
Expand Down
35 changes: 18 additions & 17 deletions README.md

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions TEMPLATES/.spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

#######################################
#######################################
## AsyncAPI and OpenAPI Linter rules ##
#######################################
#######################################

extends:
- spectral:asyncapi
- spectral:oas
6 changes: 5 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ fi

# Prettify `search_index.json` after `mkdocs`
# `mkdocs` removed its own prettify few years ago: https://github.com/mkdocs/mkdocs/pull/1128
python -m json.tool ./site/search/search_index.json >./site/search/search_index_new.json
if type python3 >/dev/null 2>/dev/null; then
python3 -m json.tool ./site/search/search_index.json >./site/search/search_index_new.json
else
python -m json.tool ./site/search/search_index.json >./site/search/search_index_new.json
fi
mv -f -- ./site/search/search_index_new.json ./site/search/search_index.json
2 changes: 1 addition & 1 deletion docs/all_linters.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
| [**shfmt**](https://github.com/mvdan/sh){target=_blank} | 3.8.0 | [BSD-3-Clause](licenses/shfmt.md) | [![GitHub stars](https://img.shields.io/github/stars/mvdan/sh?cacheSeconds=3600)](https://github.com/mvdan/sh){target=_blank} | [BASH](descriptors/bash_shfmt.md) | :no_entry_sign: | [Repository](https://github.com/mvdan/sh){target=_blank} |
| [**snakefmt**](https://github.com/snakemake/snakefmt){target=_blank} | 0.10.0 | [MIT](licenses/snakefmt.md) | [![GitHub stars](https://img.shields.io/github/stars/snakemake/snakefmt?cacheSeconds=3600)](https://github.com/snakemake/snakefmt){target=_blank} | [SNAKEMAKE](descriptors/snakemake_snakefmt.md) | :white_circle: | [Repository](https://github.com/snakemake/snakefmt){target=_blank} |
| [**snakemake**](https://github.com/snakemake/snakemake){target=_blank} | 8.10.6 | [MIT](licenses/snakemake.md) | [![GitHub stars](https://img.shields.io/github/stars/snakemake/snakemake?cacheSeconds=3600)](https://github.com/snakemake/snakemake){target=_blank} | [SNAKEMAKE](descriptors/snakemake_snakemake.md) | :white_circle: | [Repository](https://github.com/snakemake/snakemake){target=_blank} |
| [**spectral**](https://github.com/stoplightio/spectral){target=_blank} | 6.11.1 | [Apache-2.0](licenses/spectral.md) | [![GitHub stars](https://img.shields.io/github/stars/stoplightio/spectral?cacheSeconds=3600)](https://github.com/stoplightio/spectral){target=_blank} | [OPENAPI](descriptors/openapi_spectral.md) | :white_circle: | [Repository](https://github.com/stoplightio/spectral){target=_blank} |
| [**spectral**](https://github.com/stoplightio/spectral){target=_blank} | 6.11.1 | [Apache-2.0](licenses/spectral.md) | [![GitHub stars](https://img.shields.io/github/stars/stoplightio/spectral?cacheSeconds=3600)](https://github.com/stoplightio/spectral){target=_blank} | [API](descriptors/api_spectral.md)<br/> [OPENAPI](descriptors/openapi_spectral.md) | :white_circle: | [Repository](https://github.com/stoplightio/spectral){target=_blank} |
| [**sql-lint**](https://github.com/joereynolds/sql-lint){target=_blank} | 1.0.0 | [MIT](licenses/sql-lint.md) | [![GitHub stars](https://img.shields.io/github/stars/joereynolds/sql-lint?cacheSeconds=3600)](https://github.com/joereynolds/sql-lint){target=_blank} | [SQL](descriptors/sql_sql_lint.md) | :white_circle: | [Repository](https://github.com/joereynolds/sql-lint){target=_blank} |
| [**sqlfluff**](https://github.com/sqlfluff/sqlfluff){target=_blank} | 3.0.3 | [MIT](licenses/sqlfluff.md) | [![GitHub stars](https://img.shields.io/github/stars/sqlfluff/sqlfluff?cacheSeconds=3600)](https://github.com/sqlfluff/sqlfluff){target=_blank} | [SQL](descriptors/sql_sqlfluff.md) | :white_circle: | [Repository](https://github.com/sqlfluff/sqlfluff){target=_blank} |
| [**standard**](https://github.com/standard/standard){target=_blank} | 17.1.0 | [MIT](licenses/standard.md) | [![GitHub stars](https://img.shields.io/github/stars/standard/standard?cacheSeconds=3600)](https://github.com/standard/standard){target=_blank} | [JAVASCRIPT](descriptors/javascript_standard.md) | :white_circle: | [Repository](https://github.com/standard/standard){target=_blank} |
Expand Down
Loading

0 comments on commit 930d750

Please sign in to comment.