-
Notifications
You must be signed in to change notification settings - Fork 61
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
Proposed changes for 2.0 release #269
Comments
I agree with all the points. It would be a lot easier to unit test rules/checks if they returned an object with Also each check is called once per line, see #266. Maybe we could call each rule again and again until Automatic fixes would be a nice addition #236. Probalby not a breaking change and could be done as feature, but it's good to keep it in mind. Don't forget #161. |
I've created a And yes, decoupling checks, along with reporters, from Perhaps providing a way for custom checks to be registered by the user as well? |
Thinking about it, how about passing in a single object to checks, like eslint does, containing different stuff, like the line, source, config and a reporter function? http://eslint.org/docs/developer-guide/working-with-rules#the-context-object We don't have AST, but the current regex solution works fine, so no need to return anything. For testing purposes, just passing a mock as IMO, Stampit works fine within a project, but when exposing extension points for other modules, it requires too much domain knowledge. A pure function of input is easier to reason about than the internals of Thoughts? |
👍 |
@wojciechczerniak I'm going to be trying to push towards this now. Are you around to help with this? |
I was away from Github recently but I'll try to help. If were going for breaking changes I would add another one:
But I agree that testing rules should be our priority. Split core and rules test, maybe even rules into separate files. So it's easier for us to work on them. |
I think that proposed above config change would allow for easier rules testing. This way we could call rule with Instead of:
Just call:
Also asserting true/false on function result is not the final output of rule check because it calls reporter |
That sounds good to me! I'd really like for But rules and reporters should definitely not care about it, they should receive stuff as arguments, and return a result. |
Cool. So we need a plan. Refactoring rules so they are pure arguments and return object will touch every file and all test have to be rewritten then (no longer asserts are true/false). Let's do this as the last one and have everything else in place. I will try to put them in order step by step:
Lets split those into smaller tasks under 2.0 milestone. Am I missing something? I don't know where to put those two:
Also there are 18 bugs opened that need to be addressed in both versions. And 20 enhancement propositions we can assign to milestones or add To deliver 2.0 sooner than later I think those tasks should be considered as future enhancements:
|
Thanks for structuring it! Please do create issues and tag them with the milestone 😄 A few comments:
A rule shouldn't care about severity, we know that at call time.
If we think fresh, I think making linting a string work should be very easy. Most of the breakage there (IIRC) was to return different stuff, and not call
Yeah I agree. |
I created a Project for it (https://github.com/SimenB/stylint/projects/1), might be better than the milestone I think I've opened up issues for most of this now, and added them to the project. Anything missing? Make sure to pull stuff into in progress if you start work on it, and open PRs on the v2 branch. I vote for rushing towards 2.0, and then fix bugs after we have a proper testing structure in place, and can easily make regression tests for every case we fix. |
Also, we should make sure to release alphas as early and often as possible. @wojciechczerniak what's your username on npm? I'll add you there so you are able to push release in case I'm unavailable for some reason 😄 |
@danielhusar @tplusrex @awayken you are all collaborators here, are you available to contribute? @iDev0urer @Arcanemagus would you be interested in helping out with this effort? |
Also pinging people maintaining packages using stylint: @xdissent @guerrero @vtfn @jackbrewer @spyl94 @limarc |
You're right 👍
It's wojciechczerniak.
Exactly my view. Again #356 is essential here. Thanks for creating issues and updating the list. Wow, you're fast. |
Ok, added you as owner on npm as well. Please do start working on some things if you have the time 😄 If you'd be able to review my PR, that'd be a great help as well |
Honestly, @SimenB, I haven't used Stylus or Stylint for ages. We've since moved our styling to other technologies. At this point, I don't see myself having the motivation or time to contribute to the project. Sorry! |
No problem 😄 I'll just remove you as collaborator then |
@wojciechczerniak Updated the readme, does it look OK to you? |
@SimenB Very nice summary of all the goals we should aim for 👌 |
man, you guys are really cranking. this all looks great! i should have turned it over to you a long time ago |
Mostly to kick of the convo, and try to centralise it, I'll try to compose a list of potential breaking changes for a 2.0 release.
I'll just throw together a quick list now, can probably be expanded quite easily 😄
this.cache
andthis.config
(cache rule name with error message for reporters to use as they need #264 (comment))this.cache.warnings
&this.cache.errs
, have an object with some metadata (such as if it's a warning or not)this.cache.warnings
&this.cache.errs
this.state/config
. That makes them easier to write I think, as the interface is more clearly defined.init
should not callread
, as that makes testinginit
in isolation a pain. Might not be a breaking change, not sure. Also unsure if that works withstampit
?/cc @rossPatton @wojciechczerniak
The text was updated successfully, but these errors were encountered: