-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Running spectral
6.0.0 command without --ruleset
CLI option fails
#1796
Comments
Hey! |
Ouch! It is expected to make a command line option required where one was not required before? Also note that the CLI help does not document this as required either, just $ /usr/local/bin/spectral lint --help
spectral lint [documents..]
lint JSON/YAML documents from files or URLs
Positionals:
documents Location of JSON/YAML documents. Can be either a file, a glob or fetchable resource(s) on the web. [array] [default: []]
Options:
--version Show version number [boolean]
--help Show help [boolean]
[...]
-r, --ruleset path/URL to a ruleset file [string]
... ( |
I am also facing this issue, documentation across the board specifies that the ruleset is not required. IMHO it prevents people from adopting the tool simply because now you have to specify configuration even though you are actually not adding anything to it (as per your comment on #1797)
|
It's not required to provide the ruleset flag - the flag is needed only if you don't have the ruleset file in your current working directory. Otherwise, it's no longer required. That said, as long as you have
It depends on the usage of Spectral - I presume most of users actually do have their own rulesets, so they won't notice any difference. Don't get me wrong - I'm not saying we wouldn't revert the behavior, I hear you and your concerns.
You are adding an OpenAPI styleguide, so it's not such a no-op thing after all. In general, it's never been encouraged to rely on the default ruleset, as you are always at some risk when upgrading. Overall, the "default" ruleset thing was mostly the heritage of times where custom styleguides weren't a thing, thus you were forced to run the rulesets we provided, and couldn't change much. |
I'm not sure if you can validate that assumption in some way, but Spectral is part of GitHub's SuperLinter. Which has a major use case of "run this against your repo with zero config". I am not sure how SuperLinter's team is going to address this as it takes away the generic approach and forces you to go more specific. |
As far as I can see they cover plenty of various configuration files. I might be wrong, but I believe their zero-config approach means you don't need to configure SuperLinter itself. I actually went ahead and checked how
It shouldn't be a problem at all for them - they support plenty of configuration files already. |
Maybe it would be good to include the new documentation in the installation steps or link the new documentation somehow in an earlier stage. I followed the installation steps and I got stuck on:
then I checked the issues to see if anything relevant and I landed here. |
Thanks for the feedback folks. This decision was made because the goal is for Spectral to be a generic linter, with rulesets for common use cases like OpenAPI being available but not the assumed default. We have been autoguessing a lot of stuff, and now with Overrides its much easier to say "stuff in this folder is OpenAPI, stuff in this folder is GitHub Actions" or whatever other stuff needs linting. We'll get the documentation updated as part of a big of a revamp anyway, so this will become more obvious soon. This might seem like a jarring change but it's been done in a major version to avoid breaking things for anyone, so hopefully we'll get used to it. If people continue to struggle with needing a ruleset (either locally or passed in) then we look at bringing back the autoguessing. |
Describe the bug
Using 6.0.0 installed from the installation page, running lint returns an error
No ruleset has been found
To Reproduce
Expected behavior
As per the doc page , use the default ruleset (i.e.
spectral:oas
in this case)Environment:
The text was updated successfully, but these errors were encountered: