File: Rakefile

package info (click to toggle)
ruby-loofah 2.25.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 488 kB
  • sloc: ruby: 4,176; makefile: 4
file content (58 lines) | stat: -rw-r--r-- 1,272 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# frozen_string_literal: true

require "hoe/markdown"
Hoe::Markdown::Standalone.new("loofah").define_markdown_tasks

require "rake/testtask"
Rake::TestTask.new do |t|
  t.libs << "test"
  t.test_files = Dir["test/**/*.rb"]
  t.verbose = true
end

desc "generate safelists from W3C specifications"
task :generate_safelists do
  load "tasks/generate-safelists"
end

begin
  require "rubocop/rake_task"

  module RubocopHelper
    class << self
      def common_options(task)
        task.patterns += [
          "Gemfile",
          "Rakefile",
          "lib",
          "loofah.gemspec",
          "test",
        ]
      end
    end
  end

  RuboCop::RakeTask.new do |task|
    RubocopHelper.common_options(task)
  end

  desc("Generate the rubocop todo list")
  RuboCop::RakeTask.new("rubocop:todo") do |task|
    RubocopHelper.common_options(task)
    task.options << "--auto-gen-config"
    task.options << "--exclude-limit=50"
  end
  Rake::Task["rubocop:todo:autocorrect"].clear
  Rake::Task["rubocop:todo:autocorrect_all"].clear

  task(default: :rubocop)
rescue LoadError
  warn("NOTE: rubocop not available")
end

desc "Print out the files packaged in the gem"
task :debug_manifest do
  puts Bundler.load_gemspec("loofah.gemspec").files
end

task(default: :test)