When is the fixer repeated
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. As of ESLint 3. From what I understand, this restriction was introduced when the autofixers for core rules almost exclusively fixed whitespace, and didn't touch any tokens. The intention was to ensure that each fix was as small as possible, to increase the likelihood of any given fix getting applied.
There are cases where a rule wants to apply multiple fixes at separate locations. Nowadays, many autofixers modify tokens and the AST, not just whitespace. As a result, these multi-fix operations cannot be split into smaller atomic operations, because the syntax or runtime behavior of the code will be incorrect if only one fix gets applied without the other. The autofixer for no-extra-parens is a good example of this:.
The autofixer for no-extra-parens would like to remove the parentheses around the function, to obtain the following code:. Clearly, the left and right parentheses have to be removed in the same pass of the code; if only one paren is removed without the other, the resulting syntax will be invalid.
Reporting two separate errors as a workaround does not solve this issue; since the fix from any given reported error is not guaranteed to be applied, reporting an for each paren can still result in only one fix being applied under certain circumstances. Due to these restrictions, no-extra-parens and many other core rules, such as prefer-arrow-callback , quote-props , wrap-regex , etc. This workaround works because it only applies to a single text range, so it is a single contiguous fix.
However, it is not ideal. Since the resulting fix is so large, it can prevent other fixes from being applied during the same pass; this results in a larger number of passes, which hurts the performance of autofixing. The fix is also overcomplicated intuitively; for a large function, it could easily end up replacing tens of thousands of characters, even though it is only trying to remove two characters.
This problem could be solved if a rule could apply multiple fixes per reported problem. For example, the no-extra-parens autofixer would apply two fixes; a single-character fix to remove the left paren, and a single-character fix to remove the right paren. The fixes for a given reported problem would be applied atomically. In other words, there would still be no guarantee that any problem's fixes would get applied in general, but the core engine would guarantee that all the fixes for a problem would be applied simultaneously, so the code would never end up in a state where only some of a problem's fixes were applied.
Currently, fixes are applied when a fixer function returns an object with range and text keys. Usually, these fix objects are generated by helper functions such as RuleFixer replaceText. To apply multiple fixes, a fixer function could instead return an array of these fix objects. Returning a single fix object would still be supported for backwards-compatibility. For example, the fixer function for no-extra-parens would look something like this:. The text was updated successfully, but these errors were encountered:.
The current implementation is efficient in terms of time performance because fixes are applied in reverse order of starting range. This means we iterate through fixes in linear time and we do not have to alter the ranges of any fixes because a fix later in the text does not affect the location of a fix earlier in the source.
In the example above, this applies no matter which rule's fixer you apply first:. I'm sure nzakas will have many more examples. I just wanted to make sure the size of the problem which I may still be under-representing is clear.
Sorry, something went wrong. Interesting example. I'll think about whether it's possible to maintain linear time and atomicity, but I'm also wondering: How bad for overall performance would a quadratic-time implementation actually be?
For example, if a file has fixes probably much larger than the average , this requires updating ranges O times. I'm inclined to think that updating a range is computationally inexpensive, as it just requires a couple arithmetic operations, so even range updates would not cause a performance difference noticeable to the user. In comparison, doing another autofixing pass is very expensive, as it requires reparsing the file and running every rule again on the new AST.
In other words, even if this change would require the autofixing implementation to be O n 2 in the number of fixes, it might still improve performance overall by reducing the number of passes required since fewer fixes would conflict with each other. Related: If I'm understanding you correctly, it sounds like in the case of an autofix that needs to apply two changes, you'll apply the first one, then apply any intervening fixes while keeping an offset of the fixes already made so that the second one can be made in the correct location?
Not quite: I was saying I would store the text of the file as a linked list and convert all the ranges appropriately at the start. That way, the fixer wouldn't have to deal with updating ranges and offsets, and it could still be O n. Although now that you mention it, keeping an offset might also allow for O n time while keeping the solution simpler overall. Not to deter from the implementation discussion, but what do you think of the proposed API change itself? Dec 03, Nicole Wang rated it it was amazing Shelves: favorites.
Please fix the book hangover I have now Quote "You're telling me that my sister is a professional problem solver? How is that even an occupation? I've said this before, but political intrigue is definitely one of my ultimate favorites in YA--typically, they come wrapped in high fantasy shaped packages th Please fix the book hangover I have now Quote "You're telling me that my sister is a professional problem solver?
I've said this before, but political intrigue is definitely one of my ultimate favorites in YA--typically, they come wrapped in high fantasy shaped packages though, and honestly? I wasn't quite expecting this much intrigue in The Fixer. Why not? Holy shit, guys. Holy holy shit. Jennifer Lynn Barnes has just secured her spot in my Top Ten Favorite Authors list, and she's probably going to be there for a long, long time.
Right off the bat, I loved Tess. She was sarcastic, protective, and she could handle all the crap that people threw at her--which turned out to be kind of pivotal in her story. She really just It seems she can't really resist helping those with wounds to be bound, and the way she dealt with everything was honestly badass.
And kind of scary. And she was kind of incredibly incredibly good at what she does. It must be the genes. Tess has amazing deductive skills and I kind of loved her all the more for it--especially since this particular skill was shown rather than told, like so many other stories. She was blunt when she needed to be, and while she did make some reckless decisions, she was never as idiotic as to try to handle everything on her own. Really, I just wanted to tackle hug Tess--and do anything I could to stay on her good side.
She has no problem with name dropping to get what she wants. Dear god, though. Tess was so not the only fantastic character in the book. Ivy, Asher, Bodie, Vivvie, Henry--the entire cast. They all had such different personalities and they all managed to crawl into my heart. They were hilarious together and the way so many of these characters cared about each other and how they protected each other was just another added element to this book that just made me adore it.
But I'd be lying if I said the characters were the only reason I adored this book because what a plot. I stayed up until AM to read this book--which may not sound like a big deal, but it was a school day in which I had to wake up at 6 and take a test that same day. It was risky, but I took it, because who the hell can stop reading a book with a plot like this one?
There were so many twists and the whole whodunit mystery is taken to a new level that I'm absolutely obsessed with. I will admit that I kind of saw the ending coming view spoiler [ but only because I'd only recently read Pretty Wanted and the twist was on my mind.
I think I had to reread that ending several times in order for me to make sense of it. And then that open ending that left me with more questions than answers. William Keyes, by the way, is a terrifying man. I need YA political thrillers to be the next big thing.
I need it. The Fixer was by far one of my absolute favorite books of the year and I'm just stunned by how amazing it was. Filled with intrigue and characters who are much more powerful than you'd think, The Fixer is a must-read for Whether you love high fantasy, mysteries, thrillers, contemporaries, or any other genre, this book is one that I will never stop recommending.
Find more reviews at. Jul 11, Jess rated it it was amazing Shelves: gimmek , where-do-i-throw-my-money. I've reached the stage where I'd voluntarily read Barnes' shopping list.
If you love a bit of politics--the push and pull of power--than you'll eat this one right up. Review To Come. Mar 19, AH rated it really liked it Shelves: zzread-july , young-adult , blue , arc-netgalley. The Fixer was a fun and quick read.
In fact, I managed to read it on one rainy afternoon. The Fixer is the story of Tess Kendrick, a teenager who is forced to leave her Montana ranch when it becomes apparent that her grandfather is no longer able to care for her. Tess moves in with her big sister Ivy, who happens to work with a lot of very influential people in Washington D.
Ivy makes things happen and Tess seems to follow in big sister's footsteps. When a classmate's grandfather dies, Tess is The Fixer was a fun and quick read. When a classmate's grandfather dies, Tess is pulled into a strange series of events which cause her and her friends to think that something sinister is in play.
Mar 10, Lisa rated it it was ok Shelves: arc , debut-series , bloomsbury , , read-in This is a tough one. On the other, this book is a bit hard to swallow. It's not just teens solving mysteries - they're solving deep-seated political schemes that go all the way to the top.
It's Scandal meets Veronica Mars. Although I appreciated that the book is full-on uncovering government secrets, it could have done with a bit of softening with either humor or romance. Because of that I got about 70 percent through and skimmed the rest. Jul 07, Kirsty-Marie Jones rated it it was amazing. That, was fucking awesome. Bring on book 2. The end. Jun 30, Eri rated it really liked it Shelves: steal-my-heart , unwritten-reviews , i-spy-things , blood-over-water.
It was smart and slick, and I throughly enjoyed the characters and the political conspiracy behind it all. This book reminded me of my favorite police drama, with its well thought plot and the sharp twists that brought it to life.
Full review to come soon. View 2 comments. Aug 09, Sian rated it really liked it Shelves: crime-mystery-thriller , ya , law-and-politics-fiction. This is the most dramatic thing I have read in a long time and I'm stressed This is the most dramatic thing I have read in a long time and I'm stressed Jul 01, Nastassja rated it liked it Recommends it for: everyone. Shelves: mystery , young-adult , best-young-adult.
The story is about a girl Tess who moves to Washington to live with her older sister Ivy after an accident with their gr 3. And you know what? The Fixer completely satisfied my crime novel craving! Her involvement starts out minimal, but soon grows into something of epic proportions.
The book has excellent momentum and pacing, and I found it super difficult to put down! Barnes is one smart cookie. With advanced degrees in psychology from Yale University, her smarts really translate to her stories — they are written brilliantly!
She weaves such a compelling mystery that I spend the entire book analyzing every character to try to figure out whodunit. The mystery was the funnest element of The Fixer, but I also loved the characters.
One character in particular, Asher, had me busting a gut left and right. Overall Jennifer Lynn Barnes is one of my top authors and current favorite to recommend. Via The Obsessive Bookseller at www. Jul 28, Laura rated it really liked it. Murder, blackmail, secrets, and cover-ups! Watch your back. These people can slice and dice you with smiles on their faces! Smiles that can sell papers, charm the masses, and win elections.
Welcome to DC politics! Estranged sisters, Tess and Ivy Kendrick, are trying to be a family again in Washington DC, where Ivy is a problem solver in the world of politics. Ivy is that someone you want on your side. Someone who can fix anything. Fixing problems becomes her thing in the halls of her new elite DC high school.
When a death stirs up all kinds of trouble at school, home, and in the White House—both sisters find themselves in the middle of the action. Yes, I said The White House! This scandal could go all the way to the top! Have the Kendrick sisters met their match? This fast moving political thriller was like a jolt to my reading world. Politics is a rare setting for young adult fiction. And I want more, more, more! I loved it! Things can make or break you so fast. Which candidate can outlast the drama and scrutiny of the press and the mainstream long enough to last and take office?
I loved the energy and language and power of it all. What kind of character or mojo do you need to survive the ups and downs of politics though? Can you survive in DC with a heart and soul? Tess is fierce. She has a fast, witty, clever mind that puts things together quickly. You want to support her. Root for her! Plus she is surrounded by a fun cast of characters with pain and strength of their own. I liked how each new face and personality added a new layer to the suspense and mystery.
Henry was a mystery all own his own. What is he hiding behind those mint-colored eyes? Does his cold, control melt at all? Only time will tell. Then there is Asher—the hilarious, smart ass with trouble, trouble, and more trouble pumping through his blood. Smarts and sarcasm fly through the air whenever they trade jabs and share space on the page.
Will he help or hurt Tess in the long run though? The sisters have a history of pain, loss, and misunderstanding between them to unravel. I highly recommend The Fixer for anyone looking for a little something different from YA right now. It will keep you entertained and guessing until the end. The suspense of when it would all come out added to the twists and turns of the other secrets bubbling and boiling all around.
A book not to be missed. Looking forward to book two already! Jun 23, Misty rated it it was amazing Shelves: reviewed , favorites. I adore Jennifer Lynn Barnes. She is such a good writer. This is the fifth book I've read by her, so you can truly trust me when I say her books never disappoint in any way. Barnes knows how to write characters and dialogue, and this book proved that.
Tess Kendrick was such a good protagonist. She was smart and competent and totally relatable. There is true friendship portrayed in this book; no romance. Tess's friendship with Vivvie, Asher, and Henry is everything! I also love Ivy's friendship with Bodie and Adam.
Barnes also knows how to write a mystery and a plot that doesn't have any holes or stray components that aren't addressed. I flew through this book because it had me so intrigued. The writing flowed so nicely, that it was hard to stop reading once you started.
The setting was perfect. Washington D. C, the politicians, the powerful elite, and their kids. I love the idea of a 'Fixer' and a 'Kingmaker'. I loved reading about Ivy and Tess fixing problems. It makes me wonder who really is the 'Kingmaker' As for the reveal, I didn't see who the bad guy was, but I did suspect the other twist. Those last three pages were so good. I live for it! Just Bought it! Jun 13, Dahlia rated it it was amazing Shelves: top-ten-thrillers , releases.
However I felt about this book at the time, when I look back all I remember is how damn good it is and how annoyed I am that every YA thriller fan in the world hasn't read it. This was a really fun and fast-paced thriller that had me guessing wrong at literally every turn. It's been a long time since I've been this consistently surprised by a thriller and I'll definitely be picking up more by this author soon!
I personally would've loved some romance, and I'm hoping that factors in later in the series, but if you like your YAs without any, this is one of the very few I've read that can make that claim. Mar 21, Meg rated it it was amazing Shelves: favorites.
This is like YA House of Cards except the main characters aren't terrible people and it's amazing and I should've read it ages ago. Don't be like me, read it now. Jul 08, Books are TARDIS rated it it was amazing Shelves: french-the-llama , political-intrigue , kick-ass-protagonist , page-turner , awesome-siblings , sherlocking-y-all , suspense , banter-galore , crime-fiction , feeeels.
I read this book a few weeks back, but didn't get to review it till now. LOVED, loved, loved this book. Her excellent 5-star review Paige's review had me pitching this book to the front of my TBR pile.
I was hesitant to read this because of the Scandal meets Veronica Mars marketing for this book. Not only are those two things quite a lot to live up to, but also, that kind of comparison makes me think that this is going to be a cl I read this book a few weeks back, but didn't get to review it till now. Not only are those two things quite a lot to live up to, but also, that kind of comparison makes me think that this is going to be a clone of those, a derivative story.
This really is Scandal meets Veronica Mars, the comparison for once is spot-on. I LOVE all the characters in the story, they have got moxie in abundance. The story is all about the mystery and the political backstory, but foremost, it is a story about family.
The family connections are complicated and they feel SO real. The characters feel real with very complicated motivations. I usually prefer my contemporary books to be a standalone story, but not this one, I want more of this world and more of the amazing characters. The mystery in the book wasn't completely wrapped up, so there's that to look forward to as well. And while this book focused on the mystery, family and character drama, there were seedlings of romance that I'd really like to see followed up.
As the legendary V-Mars would say: Keep on keepin' on, book. View all 8 comments. Aug 09, Sam rated it really liked it. I thought I had somewhat figured it out while I was reading, but I was totally wrong.
It was so shocking and kept me guessing until the literal last page. I am a sucker for books set on the political scene, and I love suspense and mystery, therefore, I was sold on this book from the second I read the synopsis. I really like Tess our main character because she is truly a strong independent girl who isn't focused on a boy not that being focused on a boy is a bad thing , but she's been through a lot and has her sights set on her relationship with her sister, and her friends.
Tess is also very intelligent and totally badass. She hates bullies, and stands up for the kids who seem to need it most. I really admired her character.
Plus our secondary characters are amazing too! Asher, who loves explosions and is also very funny. Henry, who seems rude at first, but as we get to know him we learn there's so much more to his story. Vivvie, the extremely energetic and bubbly friend. They were all very well written side characters. Another thing that was awesome about this book was that there was absolutely no romance.
None whatsoever, yet the book was still really badass and intriguing. I actually think this is the first book I've read without a romantic relationship. It definitely proves a book can be captivating without a love interest or romance. There was never a point in The Fixer where I found myself wanting a romance either, because the story is so gripping and engaging.
I believe this is supposed to be a duology based on Goodreads and I am very excited for the next book. Jennifer Lynn Barnes is so good at throwing curve ball after curve ball and The Fixer has so many twists you'll never see coming.
Jul 10, charlotte, rated it really liked it Shelves: ya-lit , black-or-african-characters , 4-stars , im-dead-and-dying , found-family , south-asian-characters , non-white-characters , mystery-thriller. Rep: Indian side character, biracial Black side character. Feb 25, Rayne rated it really liked it Shelves: young-adult , thriller , mystery , realistic-fiction , contemporary , favorites.
Was The Fixer a blatant rip-off of the Scandal tv series? Do I care? It's been quite a while since a book had me so completely riveted, so absolutely enthralled, and, once that happens, there's very little that will stop me from really digging that book. The Fixer was very entertaining, suspenseful, and actually managed to surprise me with a couple of twists. I need to stress how important it is to me that a book surprises me. Most thrillers, mysteries and horror stories fall through for m Was The Fixer a blatant rip-off of the Scandal tv series?
Most thrillers, mysteries and horror stories fall through for me because of how predictable they are. I'm a hard person to surprise, in both reading and real life, so when someone or some book actually manages to sneak up on me, I get hung up on that and I love it. Now, it would be a disservice to attribute my feelings for this book entirely to how twisty it was, because the truth is that this is a genuinely well written, well plotted and entirely engaging novel.
The political intrigue and games, though sometimes a bit preposterous, were absolutely riveting and well carried out throughout the novel.
The suspense was handled with finesse, the pace made the pages of this novel fly by, and Barnes filled this novel with very interesting characters. Tess is a tough, smart and very engaging main character. I liked everything about her, from her attitude to her narrative voice and her actions, and thought her a very competent heroine. She was far too stubborn and impulsive sometimes and completely clueless about several crucial things, but, while that annoys me with other heroines, they all felt very authentic to Tess as a character and instead she came off as a realistic teenager to me.
I believed her feelings, her reasoning, and I even understood her temper tantrums and her stubbornness. That's the difference between having a teenager do those things because teens are supposed to act like that or because it's convenient to the plot, and allowing your character to express herself and her feelings in a way that feels natural and authentic.
I also enjoyed that the plot made it really clear all throughout the novel that this situation was well over Tess's capacity and her capabilities.
It always seems ridiculous to me when we have this big mystery and conspiracy and only teenagers are capable of discovering it and then bringing a solution to it. Tess tries really hard, but I loved that she became aware that she was in over her head on this, that she needed help and that there were some things that were well beyond her reach.
It added a layer of authenticity to the story that I really appreciated. The rest of the characters were fascinating in their own right. I genuinely and legitimately liked every single character or was at least fascinated by them, regardless of their inclinations, and it's not because Barnes made them likable, but because she made them realistic, flawed and human. They had dimensions to them, far beyond what was required of them for the sake of the plot, and I loved that I could understand them, feel the emotion behind their choices and see how every step they took made sense within the context of their characterization.
It takes a very impressive talent to make so much of secondary characters in the handful of lines they have within the book. Jennifer Aniston gushes over Paul Rudd after he bags 'sexiest man alive' title. Britney Spears' journey from teen phenom to guardianship. Paris Hilton ties the knot with Carter Reum after two years of romance. Travis Scott asks victims of Astroworld stampede to contact him for help.
Latest view all.
0コメント