-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
43 lines (36 loc) · 931 Bytes
/
Rakefile
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
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'reek/rake/task'
require 'inch/rake'
require 'forspell/cli'
require 'mdl'
RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new(:rubocop)
Reek::Rake::Task.new
Inch::Rake::Suggest.new
PATHS_TO_SPELLCHECK = ['.'].freeze
PATHS_FOR_MDL = ['README.md', 'CHANGELOG.md', Dir.glob('docs/**/*.md')].flatten.freeze
desc 'Run self spellchecking'
task :spellcheck do |_task|
puts 'Run forspell checker...'
Forspell::CLI.new(PATHS_TO_SPELLCHECK).call
rescue SystemExit => err
if err.status.zero?
puts 'Everything is ok.'
else
exit err.status
end
end
desc 'Run markdown linter'
task :mdl do |_task|
puts 'Run MDL linter...'
MarkdownLint.run(PATHS_FOR_MDL)
rescue SystemExit => err
if err.status.zero?
puts 'Everything is ok.'
else
exit err.status
end
end
task default: %i[rubocop reek spec spellcheck mdl]