diff options
Diffstat (limited to 'Rakefile')
| -rw-r--r-- | Rakefile | 19 | 
1 files changed, 17 insertions, 2 deletions
@@ -37,12 +37,27 @@ RSpec::Core::RakeTask.new(:acceptance) do |t|    t.pattern = 'spec/acceptance'  end -desc 'Run tests metadata_lint, release_checks' +desc 'Run tests release_checks'  task test: [ -  :metadata_lint,    :release_checks,  ] +namespace :check do +  desc 'Check for trailing whitespace' +  task :trailing_whitespace do +    Dir.glob('**/*.md', File::FNM_DOTMATCH).sort.each do |filename| +      next if filename =~ %r{^((modules|acceptance|\.?vendor|spec/fixtures|pkg)/|REFERENCE.md)} +      File.foreach(filename).each_with_index do |line, index| +        if line =~ %r{\s\n$} +          puts "#{filename} has trailing whitespace on line #{index + 1}" +          exit 1 +        end +      end +    end +  end +end +Rake::Task[:release_checks].enhance ['check:trailing_whitespace'] +  desc "Run main 'test' task and report merged results to coveralls"  task test_with_coveralls: [:test] do    if Dir.exist?(File.expand_path('../lib', __FILE__))  | 
