SimenB / stylint

Improve your Stylus code with Stylint
https://simenb.github.io/stylint/
GNU General Public License v2.0
348 stars 62 forks source link

[v2] Return unformatted reporter with pretty option #398

Closed emmabukacek closed 6 years ago

emmabukacek commented 7 years ago

Issues

Changes

Additional

Code Coverage

screen shot 2017-09-06 at 11 54 52 pm screen shot 2017-09-06 at 11 54 56 pm

getinsertpic.com

SimenB commented 7 years ago

Thank you for the PR, sorry about the slow response!

The change itself is a good start, but could you make the PR for the v2 branch instead? You'll get quite a lot of conflicts, sorry about that.

To answer your questions:

This breaks the default behavior of the formatting in favor of the old format.

That's fine

Leaving in the 'pretty' reporter seems like a good idea in case some editor parsers updated their code to match. If not, I can strip all that out and we can just revert the commit.

That's also fine, but if you could make --pretty somehow set the reporter option instead of being it's own config inside of stylint, that would be nice πŸ˜„ If it's unlcear what I mean, don't hesitate to ask.

If it needs to go into a separate file altogether, I can do that.

Yes please, ties into ^

Let me know there's a more acceptable place to store the pretty flag.

I kinda answered above, was that understandable?

Again, sorry about the late response

emmabukacek commented 7 years ago

@SimenB Hey, no problem! Thanks for the response! I'm sorry I'm also late, :grimacing: I'll get on this as soon as I can. So I need to:

:smile:

SimenB commented 7 years ago

Profit after those 2 things, yeah!

emmabukacek commented 7 years ago

Hey @SimenB , so in the heart of async communication, I figured I'd let you know where I'm at and what I'm thinking.

So far, I've rebased my branch onto v2 (rendering most of my code bunk :laughing: ) and started undergoing the process to add the reporter into a separate file.

In the spirit of solving these issues:

This is the approach I'm taking in this PR:

In the next PR (to make reviews manageable, but can be put into one), I would:

This is making some bigger architectural decisions, so feel free to shut me down, but I figured this was a little more comprehensive than what I originally introduced. Adding the formatters aligns with ESLint (which seems to be a common theme), helps add organization, and makes future formatters, i.e. json, a bit easier to bolt on.

Thoughts?

SimenB commented 7 years ago

Not so async, woo!

This is the approach I'm taking in this PR:

All of those points SGTM.

In the next PR (to make reviews manageable, but can be put into one), I would:

2 PRs also SGTM πŸ˜„

Thoughts?

You're awesome, thanks for stepping up!

Sorry about v2 killing a lot of your code, that's what I was sorta afraid of...

SimenB commented 7 years ago

@emmabukacek ProTipℒ️ run eslint . --fix from the root of the project, and it should cover up at least some of your CoffeeScript habits πŸ₯‡

I might add it as a precommit hook, but that might be a bit too much...

emmabukacek commented 6 years ago

Hey @SimenB , I'm just about done with this, but I'm at a bit of an impasse. Based on the tickets I've read, it appears that we want four ways to load in formatters:

Now this is fine and dandy if it comes from the .stylintrc file and with a few tweaks, all of these should work. However, how do we want to handle CLI arguments? Passing in a configuration isn't really realistic (JSON in the CLI sounds gross), but I think we could reasonably handle the first three if we're smart about it. I was thinking about having this syntax:

Anyway, just some thoughts. Let me know if you agree or have any ideas; I'm close to the finish line on this (I think, anyway :laughing: ) and I want to make sure I do it right.

Thanks!

wojciechczerniak commented 6 years ago

I would use --formatter, no need for specific commands.

Could attempt native, 3rd party, then a specific path.

πŸ‘

but that means that you would have to write a root file as ./formatter.js instead of just formatter.js

And that's ok. Some npm modules have dot in their name so formatter.js can still be a third party formatter module. Presence of / is obvious we deal with a path. There is an exception though , scoped modules @scope/project-name.

emmabukacek commented 6 years ago

@wojciechczerniak Yeah, that's a good point with the scoping. I'll try to throw together a solid series of tests to make sure we have our bases covered. Thanks for confirming for me!

emmabukacek commented 6 years ago

Okay, I think this is ready for an actual review! @SimenB @wojciechczerniak Happy to make any changes.

Once we're done here, I've got a few more PRs:

https://github.com/SimenB/stylint/pull/424 - formatterOptions -> formatter https://github.com/SimenB/stylint/pull/425 - A little clean-up

Obviously the latter is biased, but it looked like the repo was going towards spaces and I wanted to knock out that TODO. No hard feelings if it's not needed. πŸ˜„

SimenB commented 6 years ago

I'll review this later today, I swear!

emmabukacek commented 6 years ago

@SimenB Ugh, sorry to make you review the code twice, heh. I meant for this to be split from https://github.com/SimenB/stylint/pull/424 so it was easier to review, but somewhere along the lines, they were combined. :woman_facepalming: Closing this out.