Put the oil, onion and pancetta in a frying pan over a low heat and cook, stirring occasionally, for 7–8 minutes until the onion is soft and the pancetta is golden. Add the garlic and chilli and cook, stirring, for 1 minute, then stir in the tomatoes. Season with salt and pepper and bring to the boil. Reduce the heat and simmer very gently for 40 minutes, adding a little water if the sauce begins to stick. The sauce can be prepared ahead up to this stage, if you like.
Cook the pasta in a large saucepan of salted boiling water according to the packet instructions until al dente. Drain, reserving a ladleful of the cooking water. Return the pasta to the saucepan.
If the sauce was prepared ahead, heat through before adding it to the pasta. Stir over a medium heat to combine, then add the reserved pasta cooking water and continue stirring until the pasta is well coated and looks silky. Serve immediately with a scattering of grated Parmesan or pecorino, if liked.