Skip to content

Instantly share code, notes, and snippets.

@simpsonjulian
Created April 1, 2011 15:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simpsonjulian/898354 to your computer and use it in GitHub Desktop.
Save simpsonjulian/898354 to your computer and use it in GitHub Desktop.
Zero tolerance
desc "Check for tabs and trailing spaces"
task :crapcheck do
Dir["public/**/*.js"].each do |f|
next if f.match(/^lib|resources/)
text = File.read(f)
raise "Tabs found in #{f}" if text.match(/\t/)
raise "Trailing spaces found in #{f}" if text.match(/ $| $/)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment