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

Found X rules verbose message is misleading #435

Closed
philsturgeon opened this issue Aug 12, 2019 · 2 comments · Fixed by #587
Closed

Found X rules verbose message is misleading #435

philsturgeon opened this issue Aug 12, 2019 · 2 comments · Fixed by #587
Assignees
Labels
t/bug Something isn't working

Comments

@philsturgeon
Copy link
Contributor

philsturgeon commented Aug 12, 2019

Describe the bug

If you disable rules by turning them off, the verbose message "Found 35 rules" still shows up, counting the total list of all rules that are known about even if they are disabled.

To Reproduce

Make a ruleset like this:

ruleset.yaml

extends: [[spectral:oas3, off]]

rules:
  only-local-references: true

Run

$ yarn spectral lint examples/openapi.yaml -v --ruleset=ruleset.yaml

Linting ./examples/openapi.yaml
Adding OpenAPI 3.x functions
Found 35 rules
No errors or warnings found!
Done in 1.33s.

Current behavior
CLI output contains Found 35 rules

Expected behavior
CLI output should contain Found 1 rule

Make sure its saying 1 rule not 1 rules

Environment (remove any that are not applicable):

  • Library version: 4.0.2
  • OS: [e.g. Windows 7]
  • Browser: [e.g. Chrome 61]

Additional context

This came up in #434

@P0lip
Copy link
Contributor

P0lip commented Aug 18, 2019

I'd say, we should still say found 35 rules and additionally display how many of them are disabled, i.e.
found 35 rules (1 enabled).
Frankly speaking, if Found 1 rule text was printed, I would think there are no other rules in the ruleset while it's untrue - there are others, but they are just disabled.

@nulltoken
Copy link
Contributor

This would fit me perfectly!

@philsturgeon philsturgeon added this to the Sept '19 Hardening milestone Aug 23, 2019
@philsturgeon philsturgeon modified the milestones: Sept '19 Hardening, Aug '19 Hardening Aug 30, 2019
@P0lip P0lip self-assigned this Sep 23, 2019
@P0lip P0lip removed this from the Sept '19 Hardening milestone May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants