-
Notifications
You must be signed in to change notification settings - Fork 58
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
New: Enable autofix (--fix) #97
Conversation
Such little code? Coool. :) |
Wow, this is excellent, thank you! 🎉 I had no idea it could take so little code. Can you add some tests? I'm thinking two sets:
I care a lot more about checking edge cases in the processor tests, and a couple integration tests for the plugin ought to be sufficient. |
Yeah, turns out that's all we need to enable the feature. Already tried this in our webpack docs and it worked as expected - fixed around 500 linter issues in under 4 seconds. Sure thing will add some test cases, probably tomorrow. Gonna ping you once ready for review :) |
@btmills please have a look at the test cases I've added. I had to move |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional autofix tests
|
Hey @btmills! I've finally managed to overcome all the obstacles and have covered all edge cases you shared with me. Please have a look at the updated code and let me know if this would be good enough to proceed. Thanks |
Hey @byzyk! Great work covering those edge cases 👏 I'm really excited about this 🎉 Based on your comment about the indent weirdness, and building on your two list indent tests, I started digging to see what the boundaries of the indent edge cases might be, starting with the CommonMark spec. Eliding heavily, here's the relevant portions:
I can see the code as it currently stands works with fenced code blocks indented by 2 spaces, so with that as a starting point and the spec as a boundary, I tried 3 other cases:
In all three code blocks, Other avenues I'm researching:
So that's where I'm stuck. Thoughts on this are appreciated, brilliant insights even more so! ✨ |
Hey @btmills! Thanks for digging into it on such deep level. I assume none of the above examples are working correctly with the current implementation, right? That's really frustrating as there is no clear definition of I suggest we can open an issue in the parser, asking for clarifications from its maintainers and add a note to the readme file, something like:
And merge it as it (with readme note) just to get this going. Let's see where it's gonna take us, perhaps we just discovered a bug in parser or we just really misunderstood something. Regardless, some help from the outside won't harm. What do you think? |
Hey @btmills, just a friendly ping 🙂 What's the best way to move forward with this feature in your opinion? |
Hi @byzyk! Sorry for the delay on this. I just went back in with fresh eyes to see if I could figure anything out, and I made no more progress than either one of us did last time. With that in mind, I think your suggestion makes sense:
Feel free to go ahead and do the first two, or let me know if you'd like me to handle those! |
@btmills hey man! Just a quick update. I bumped the parser version to the latest one, added a note in README and created an issue in parser repo describing our case. Looking forward to hearing your feedback 🔥 |
Any news here? 🙂 |
@SimenB I guess maintainers still have to review changes and unfortunately we haven't been able to make the feature work for code blocks inside lists. |
🎉 d2243ac 🦄 First off, sorry for the lack of responsiveness here. I really want to release v1.0.0, and I really want it to include autofix, but I didn't like that it could break code in certain valid, albeit rare, edge cases. I'd been coming back to this off and on and couldn't figure out a solution, and I kept putting it off until now. I think I've finally figured out how to handle the edge cases. Please try to break it, and send a test case if you can! I did my best to comment the code to explain what's going on, but let me know if I missed anything. I'll give this some time for people to look over then merge and publish a release candidate if all goes well. |
Awesome work man! This is really cool that you've managed to overcome it in the end 👍🏽 I'll try to scrap some time this week to play around it. Will keep you posted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work 👍🏽
Hey @btmills, just wanted to give a quick update. I removed the note about usage in lists in README. Also played a bit with new functionality and it looks pretty solid to me. That said, it's good to go from my end 👏🏼 Let me know if you need any help before we finally merge this bad boy 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your patience iterating on this, @byzyk - merging!
Thanks, @btmills! 🎉🎉🎉 |
sweet! i'll try it |
Fixes #58