-
Notifications
You must be signed in to change notification settings - Fork 16
/
Rakefile
63 lines (54 loc) · 1.46 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
require 'bundler/gem_tasks'
require 'rubocop/rake_task'
require 'rspec/core/rake_task'
require 'yamllint/rake_task'
RSpec::Core::RakeTask.new(:spec)
desc 'Run all linters on the codebase'
task :linters do
Rake::Task['rubocop'].invoke
end
desc 'rubocop compliancy checks'
RuboCop::RakeTask.new(:rubocop) do |t|
t.patterns = %w[lib/**/*.rb lib/*.rb spec/*.rb]
end
desc 'yamllint rake test'
YamlLint::RakeTask.new do |t|
t.paths = %w[spec/data/valid*]
end
desc 'yamllint rake test with exclude_paths'
YamlLint::RakeTask.new(:yamllint_exclude_paths) do |t|
t.paths = %w[
spec/data/*
]
t.exclude_paths = %w[
spec/data/custom_extension.eyaml
spec/data/invalid.yaml
spec/data/overlapping_keys.yaml
spec/data/overlapping_keys_deep.yaml
spec/data/wrong_extension.txt
]
end
desc 'yamllint rake test disabled file ext check'
YamlLint::RakeTask.new(:yamllint_disable_ext_check) do |t|
t.paths = %w[spec/data/wrong_extension.txt]
t.disable_ext_check = true
end
desc 'yamllint rake test disabled file ext check'
YamlLint::RakeTask.new(:yamllint_custom_ext) do |t|
t.paths = %w[spec/data/custom_extension.eyaml]
t.extensions = %w[eyaml]
end
desc 'yamllint rake test disabled file ext check'
YamlLint::RakeTask.new(:yamllint_debug_logging) do |t|
t.paths = %w[spec/data/valid.yaml]
t.debug = true
end
task default: %i[
rubocop
yamllint
yamllint_exclude_paths
yamllint_disable_ext_check
yamllint_custom_ext
yamllint_debug_logging
spec
]