ci: pin @stoplight/spectral-rulesets to 1.22.2#1966
Conversation
Version 1.22.3 introduces a regression in the duplicated-entry-in-enum rule that crashes Spectral with "Cannot read properties of null (reading 'enum')". See stoplightio/spectral#2959. Pin until the fix in #2960/#2963 is released.
Co-authored-by: Patrik Ragnarsson <patrik@starkast.net>
No, I think it is a feature that it is not handled automatically. We should upgrade when there's a need, not because there's a new version. In this area, I think that is a completely fine approach. |
| .PHONY: lint-openapi | ||
| lint-openapi: | ||
| npx --package=@stoplight/spectral-cli spectral --ruleset openapi/.spectral.json lint static/docs/openapi.yaml | ||
| npx --yes --package=@stoplight/spectral-cli -p @stoplight/spectral-rulesets@1.22.2 spectral --ruleset openapi/.spectral.json lint static/docs/openapi.yaml |
There was a problem hiding this comment.
This must be what we want?
| npx --yes --package=@stoplight/spectral-cli -p @stoplight/spectral-rulesets@1.22.2 spectral --ruleset openapi/.spectral.json lint static/docs/openapi.yaml | |
| npx --yes --package=@stoplight/spectral-rulesets@1.22.2 spectral --ruleset openapi/.spectral.json lint static/docs/openapi.yaml |
There was a problem hiding this comment.
I think it should be
npx --yes --package=@stoplight/spectral-cli --package=@stoplight/spectral-rulesets@1.22.2 spectral --ruleset openapi/.spectral.json lint static/docs/openapi.yaml
There was a problem hiding this comment.
Ah right, it is the @stoplight/spectral-cli dependency @stoplight/spectral-rulesets we need to pin. That makes me wonder how many other dependencies @stoplight/spectral-cli have? That we aren't pinning?
...19 in total it seems: https://www.npmjs.com/package/@stoplight/spectral-cli?activeTab=dependencies 😐
Okay! Yeah I guess there's no need to be bleeding edge on lint rules :) |
Summary
@stoplight/spectral-rulesetsto1.22.2in thelint-openapitarget.1.22.3introduced a regression in theduplicated-entry-in-enumrule that crashes Spectral withCannot read properties of null (reading 'enum'). See stoplightio/spectral#2959.Test plan
make lint-openapipasses locally with the pin (0 errors, pre-existing warnings only).