After sitting on a ruling for months, a federal judge in Texas has given the Trump administration and a group of Republican-led states exactly what they asked for, and then some: the invalidation of the entire Affordable Care Act.

Don't panic. The ruling, issued late on Friday and only one day before the end of the law’s annual open enrollment period, is not a model of constitutional or statutory analysis. It’s instead a predictable exercise in motivated reasoning — drafted by a jurist with a history of ruling against policies and laws advanced by President Barack Obama.

The reason the judge, Reed O’Connor, gets these cases isn’t a mystery: Texas and its allied states know the game and shop these lawsuits right into Judge O’Connor’s courtroom.

Another thing that isn’t a mystery? The genesis of this latest attack on Obamacare. Disenchanted that a Republican-controlled federal government wouldn’t repeal every word of the law, Texas and a coalition of states tried a sleight of hand: They leaned on President Trump’s 2017 tax bill, known officially as the Tax Cuts and Jobs Act — which zeroed out the tax penalty of the health care law’s individual mandate — and argued that the mandate itself was unconstitutional.