Run style check on the file as staged

Previously, unstaged changes would be included in the style check.

That gave rise to several confusing and annoying errors.
Add support for filtering checked files by extension

It's currently required, but maybe I should make it optional.

It just seems unlikely that by default you'll want to scan every file in
a project.
Fix style checking for files in subdirectories

I broke it a few commits back. It works again now, and there's a test to
make sure it stays that way.