-
Notifications
You must be signed in to change notification settings - Fork 80
[WIP] Rewriting Skip Logic #204
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
Conversation
25d4cd8 to
8d5237b
Compare
|
@philsturgeon working on this today! |
|
@philsturgeon what kind of interface do you need for skipping linter rules? I've added a simple array |
|
@MikeRalphson that should work! I'll give it a try with that branch. Basically so long as I can pass something from the CLI to the linter (ofc going via the validator), and that thing won't get too upset if there are multiple linters running at the same time, then we're all set. |
|
@MikeRalphson one of the remaining differences between the two linters is how we add lint rules. We have a loader which handles all file related loading. It's a bit of a mess and there's some daft duplication that could be refactored, but it handles loading the rules files instead of having loading logic directly in the linter. https://github.com/wework/speccy/blob/master/lib/loader.js#L131 Doing this means we can add rules dynamically, which makes for some good testing, and theoretically better separation of concerns. The only other difference is relevantRules which doesnt matter, as its main job is to skip stuff and your skip logic takes care of that. |
|
So if I split my file loader into a loader and a parser for setting up new rules, will that be enough? |
|
That’d be ideal!
—
Phil Sturgeon
… On Dec 8, 2018, at 03:16, Mike Ralphson ***@***.***> wrote:
So if I split my file loader into a loader and a parser for setting up new rules, will that be enough?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
Cool. |
|
@philsturgeon I have done a simple try at making use of oas-linter for linting and removing all the current lint logic in speccy. This is the direction you'd like to take right? Just for insight you can have a look at https://github.com/pderaaij/speccy/pull/1/files for what I have done. If this is the right path I will work on fixing tests and make things proper. |
|
Superseded by #248 |
skip has been broken since v0.8, and this branch is attempting to fix it.
The current implementation is setting a variable scoped to the linter module, but that gets wiped out and is prone torace conditions, which is why the test suite is failing on this PR.
Another approach I attempted was converting the linter to be an ES6 class so I could instantiate different instances for the test suite, but that is a large divergence from oas-kit and we're meant to be getting closer not further apart.
@MikeRalphson at this point I'm wondering if you can use your superior intelligence and coding abilities to see the use case here and add a feature to oas-linter, so I can just delete my linter and tests and use that.
Maybe I can bribe you at API Days? :D