5 ms·
We do. The entire Flow test suite passes when pretty-printing and re-parsing and comparing ASTs. There are a very few subtle bugs like the one you mentioned ab
by jlongster 10y ago
We do. The entire Flow test suite passes when pretty-printing and re-parsing and comparing ASTs.
There are a very few subtle bugs like the one you mentioned above. As noted in the readme, this is a beta. It's certainly more than an attempt.
- moogleii 10y agoI'm actually very excited by your "attempt". Looking forward to where it goes!
- artursapek 10y agoDon't let HN negativity get you down. This is an awesome project and I'll contribute bug fixes/test cases if we end up adopting it on our team (very likely based on your blog post).
- mi_lk 10y agothe parent gave an ill example and suggest a solution, how's that a negativity?
- dangoor 10y agoI believe it was the "Nice attempt, but currently wrong." at the start of the comment. "Nice attempt" could imply that this should be thrown out in favor of another attempt to solve the problem.
- acdha 10y agoAlso, “currently wrong” is a really sweeping statement to make based on a single problem written in a fairly uncommon style. Yes, there are things which need to be fixed but that doesn't mean we have to be so dismissive of someone else's work which they've given away for free to the community.
- n42 10y agoThe entire comment was patronizing. "Nice attempt" minimizes the effort involved and implies the author is a novice. "but currently wrong" categorizes the entire project as a failure because of a single bug. The followup "From my own experience writing a formatter" really drives the whole thing home.
- artursapek 10y agoClassic HN :-)
- tomp 10y agoWasn't meant that way.
- softawre 10y ago"Nice attempt" used to actually mean the words it said. You know, like "nice job".
- artursapek 10y agoLike dangoor said, it was the way it was delivered.
- tlrobinson 10y agoRunning existing codebases through it and comparing the ASTs is a nice idea. Seems like it should be pretty easy to automated it for the top N (100?) JavaScript projects.
- mnarayan01 10y agoI think what the GP is saying is to do the re-parsing before/after every time you reformat (and then presumably error exit if the ASTs don't match). When/if you no longer have any known bugs like that you might want to remove it, but it does seem like a good idea until you get there.