Place the chickpeas, bay leaf, garlic clove, and 1 teaspoon salt in a large saucepan, cover with water, and bring to a boil over high heat. Reduce heat to low, and simmer, covered, adding hot water as needed, for 30 minutes. Drain and remove the bay leaf. This step can be done up to a week in advance.
In a large skillet, heat the olive oil over medium heat. Add the onion and sauté until soft, 3 to 5 minutes. Add the chile pepper, tomatoes, and basil or parsley. Stir in 1 teaspoon salt and black pepper, to taste. Allow to cook 5 minutes.
Add the cooked chickpeas to the tomato mixture, cover, and simmer for 30 minutes, or until chickpeas are tender.
Bring a large pot of water to boil over high heat. Season with a teaspoon of salt, add the cavatelli, stir, and reduce heat to medium-low. Allow to cook for about 10 minutes, or until pasta is al dente.
Drain the pasta and toss it with ladle fulls of the sauce. Garnish with freshly grated Pecorino and serve.