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.