Preheat the oven to fan 200C/conventional 220C/gas 7. Put the onion, courgettes and garlic into a large ovenproof dish. Slosh over the olive oil, season well and give everything a quick stir, then roast for 15 minutes. Stir in the tomatoes into the veg and continue roasting for 15 minutes more. At the same time, bring a large pan of salted water to the boil so the sauce and pasta will be finished at the same time.
Drop the pasta into the boiling water and cook according to pack instructions; about 9-12 minutes.
Drain the pasta. Take the vegetables out of the oven and pop the garlic cloves out of their skins. Mash the garlic against the side of the dish and stir through the vegetables. Tip in the pasta and toss everything together, tearing in some basil as you go. Pile into two bowls and serve with grated parmesan.