Skip to content

Commit

Permalink
Have the build fail when spelling mistakes are found.
Browse files Browse the repository at this point in the history
  • Loading branch information
djanowski committed May 13, 2015
1 parent f28a8df commit 3fbe93b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ task :spellcheck do
io.puts(File.read("wordlist"))
end

errors = false

Dir["**/*.md"].each do |file|
command = %q{
ruby -pe 'gsub /^ .*$/, ""' |
Expand All @@ -41,8 +43,13 @@ task :spellcheck do
line[/^& ([^ ]+)/, 1]
end.compact

puts "#{file}: #{words.uniq.sort.join(" ")}" if words.any?
if words.size > 0
errors = true
puts("#{file}: #{words.uniq.sort.join(" ")}")
end
end

abort("Spelling errors found.") if errors
end

namespace :format do
Expand Down

0 comments on commit 3fbe93b

Please sign in to comment.