question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request for feedback: Using custom rulesets with Spectral CLI

See original GitHub issue

Request for feedback!

We would love to hear from users what syntax you would like to used – please comment with your feedback!

I’m submitting a…

feature request

What is the current behavior?

Currently, the CLI detects if you are using a OpenAPI 2 or 3 based document and uses the default rulesets. No specifications or rulesets outside of that works with it.

What is the expected behavior?

You have the ability to use any custom ruleset when using the Spectral CLI.

One potential syntax could be:

spectral lint foo.yaml --ruleset=whatever.json --ruleset=advanced.js

What is the motivation / use case for changing the behavior?

One of the things that makes Spectral so great is the ability to build out custom rulesets, which can already be done now, but not in the CLI.

Other information

We are also exploring adding a ESLint or TSLint like config file (i.e. .spectralrc) with all the plugins/rules/presets setup. Current plan is that this would come after adding the custom ruleset option to the CLI.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
philsturgeoncommented, Apr 17, 2019

@chris-miaskowski is working on the implementation for this over here #144. Let’s discuss details over there.

0reactions
philsturgeoncommented, Jun 27, 2019

This was done a while back, we just forgot to close the issue somehow 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Rulesets in GitHub Action #327 - stoplightio/spectral
As a slightly technical user who is dipping my toe into the world of API Specs, I would like to get feedback in...
Read more >
More Flexible JSON Linting with Spectral 4.0 - Stoplight Blog
Use the CLI with multiple, custom rulesets. We found that most Spectral users would prefer to lint their documents from the command line, ......
Read more >
Distribute Spectral Style Guides with NPM | APIs You Won't Hate
Both tools let you define all the rules you need for your API Style Guide in YAML or JSON, and distribute them via...
Read more >
Spectral v4 & Creating You Own Custom API Design Style Guide
APIs should have style guides with rules and be reviewed to ensure they are descriptive, readable, and concise for the developers who use...
Read more >
Test Driven Development for Your Spectral Rules, using Jest
How to write unit tests for Spectral API linting, ... faster feedback on the rules, to make sure that the rules actually apply...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found