Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for overriding rules... #51

Open
markweitzel opened this issue Jan 6, 2022 · 2 comments
Open

Add example for overriding rules... #51

markweitzel opened this issue Jan 6, 2022 · 2 comments

Comments

@markweitzel
Copy link
Member

In Azure Ruleset Readmen we talk about overriding the rule set. We should show an example here of how to do this.

@mikekistler
Copy link
Member

I've tested the override support in Spectral and it seems to work. Here's an example:

extends:
  - ../azure-api-style-guide/spectral.yaml
overrides:
  # Turn off rules for cognitive svcs APIs
  - files:
      - specification/cognitiveservices/**/*.json
    rules:
      # az-operation-id: off
      az-version-policy: off
      az-version-convention: off

Unfortunately, the override support is a feature of Spectral v6, and the VSCode plugin for Spectral currently uses Spectral v5.9, so the overrides do not work when using the Spectral VSCode plugin.

It looks like there is an effort to get the Spectral VSCode plugin updated to v6:

stoplightio/vscode-spectral#107

@mikekistler
Copy link
Member

Another Spectral issue related to rule overrides:

stoplightio/spectral#2036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants