I drilled two sets of holes into the studs because the first set did not yield a level shelf. The second one didn’t quite get there, either, so I did some messed up stuff with brackets and washers to get it level.
It’s a good thing I have a low-stakes domain to practice on!