2019-02-07 03:04:17 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-12-03 16:37:36 +08:00
|
|
|
require 'rubygems'
|
|
|
|
require 'cucumber'
|
|
|
|
require 'cucumber/rake/task'
|
2019-02-07 01:40:40 +08:00
|
|
|
require 'mkmf'
|
2018-12-03 16:37:36 +08:00
|
|
|
|
|
|
|
Cucumber::Rake::Task.new(:features) do |t|
|
|
|
|
t.cucumber_opts = "--format pretty"
|
2019-02-07 01:40:40 +08:00
|
|
|
end
|
|
|
|
|
2019-03-08 01:22:00 +08:00
|
|
|
desc("Formats the code style")
|
|
|
|
task :style_correct do
|
|
|
|
system("swiftformat", ".")
|
|
|
|
system("swiftlint", "autocorrect")
|
2019-02-07 01:40:40 +08:00
|
|
|
end
|
|
|
|
|
2019-02-07 03:04:17 +08:00
|
|
|
desc("Lints the Ruby code style")
|
|
|
|
task :style_ruby do
|
2019-03-08 01:22:00 +08:00
|
|
|
system("bundle", "exec", "rubocop")
|
2019-02-07 03:04:17 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
desc("Corrects the issues with the Ruby style")
|
|
|
|
task :style_ruby_correct do
|
2019-03-08 01:22:00 +08:00
|
|
|
system("bundle", "exec", "rubocop", "-a")
|
2019-02-07 03:04:17 +08:00
|
|
|
end
|
2019-02-07 01:40:40 +08:00
|
|
|
|
2019-03-08 01:22:00 +08:00
|
|
|
def system(*args)
|
|
|
|
Kernel.system(*args) || abort
|
2019-03-08 22:20:12 +08:00
|
|
|
end
|