Rewrote Jo-Philipp Wich's patch so it applies to source files rather than generated files. Closes #701 Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>