Fry the shallots in the oil for 5 minutes in a large frying-pan, and then add the rosemary and fry gently for a further minute. Add the tomatoes, salt and the chilli, and cook, uncovered, over a moderate heat, for 20 minutes. Taste and adjust the seasoning.
Meanwhile, cook the pasta according to pack instructions until al dente.