Skip to content

Commit

Permalink
docs: update ruleset documentation and running procedures
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki committed Aug 3, 2022
1 parent 1e4162a commit b146a17
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions spectral/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,19 @@ A custom ruleset for [Spectral](https://stoplight.io/open-source/spectral/) foll
To use this Spectral ruleset add the following to your `.spectral.yaml`:

```yaml
extends: '@rhoas/spectral-ruleset'
extends: "@rhoas/spectral-ruleset"
```
Alternatively you need to create new ruleset
```shell
echo 'extends: @rhoas/spectral-ruleset' > .spectral.yaml
echo 'extends: "@rhoas/spectral-ruleset"' > .spectral.yaml
```
Run the Spectral CLI with npx:
You can run ruleset as follows
```shell
npx @rhoas/spectral-ruleset lint openapi.yaml
```

or npm global:

```shell
npm i -g npx @rhoas/spectral-ruleset
npm install -g @rhoas/spectral-ruleset
rhoasapi lint openapi.yaml
```
Expand Down Expand Up @@ -260,5 +254,6 @@ Validate OpenAPI files using the uncompiled ruleset:

```shell
yarn build
yarn spectral-lint ./examples/openapi-valid.yaml
npm link .
rhoasapi lint ./examples/openapi-valid.yaml
```

0 comments on commit b146a17

Please sign in to comment.