Campanelle with Roasted Broccoli and Walnuts

Modified from Real Simple.
Ingredients:
12 ounces campanelle or some other pasta (3 cups)
1 bunch broccoli (1 1/2 pounds), cut into small florets
1/2 cup walnuts, roughly chopped
1/4 cup olive oil
2 cloves garlic, chopped
kosher salt and black pepper
2 tablespoons unsalted butter
1/4 cup grated Parmesan (1 ounce)
red pepper flakes

Heat oven to 400° F.
Cook the pasta according to the package directions. Reserve 3/4 cup of the cooking water, drain the pasta, and return it to the pot.
Meanwhile, on a rimmed baking sheet, toss the broccoli, walnuts, oil, garlic, 1/2 teaspoon salt, and 1/4 teaspoon pepper. Roast, tossing once, until the broccoli is tender, 12 to 18 minutes.
Toss the pasta with the broccoli mixture, butter, and 1/2 cup of the reserved pasta water. (Add more water if the pasta seems dry.) Sprinkle with the Parmesan before serving. Add red pepper flakes to taste.