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

Rule overrides with file paths don't work #2587

Closed
jcageman opened this issue Feb 20, 2024 · 2 comments
Closed

Rule overrides with file paths don't work #2587

jcageman opened this issue Feb 20, 2024 · 2 comments

Comments

@jcageman
Copy link

This is a repost of : #2424 and in my opinion it's a bug that simple overrides won't work, such as:

overrides:
  - files:
      - "folder1/*.yml"
    rules:
      info-description: off

I now i have to work with relative paths compared to the location i am calling the script from which i think is not super nice. Documentation suggests it's possible given the examples, but they don't work. See documentation: https://docs.stoplight.io/docs/spectral/293426e270fac-overrides

Particular files/folders files: ['schemas/**/*.draft7.json']

@aleung
Copy link

aleung commented Mar 6, 2024

Where is your ruleset file?

I just figured out that the file path should be related to the ruleset file but not the current directory.

For example, if the project folder structure is like below, the file path needs to be ../folder1/*.yml

/my_project
           /config
                   /spectral.yaml
           /folder1
                   /api_x.yml
                   /api_y.yml

@jcageman
Copy link
Author

jcageman commented Mar 6, 2024

this is indeed similar to my folder structure, i think it's confusing that its relative to the spectral config to be honest and it makes more sense that it just does pattern matching on the files checked instead. E.g. regex like.

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

3 participants