forked from deivid-rodriguez/byebug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
116 lines (86 loc) · 2.25 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# frozen_string_literal: true
require "bundler/gem_tasks"
require "chandler/tasks"
require "rake/extensiontask"
require "yard"
#
# Add chandler as a prerequisite for `rake release`
#
task "release:rubygem_push" => "chandler:push"
#
# Prepend DevKit into compilation phase
#
if Gem.win_platform?
desc "Activates DevKit"
task :devkit do
begin
require "devkit"
rescue LoadError
abort "Failed to load DevKit required for compilation"
end
end
task compile: :devkit
end
spec = Gem::Specification.load("byebug.gemspec")
Rake::ExtensionTask.new("byebug", spec) { |ext| ext.lib_dir = "lib/byebug" }
desc "Runs the test suite"
task :test do
require_relative "test/minitest_runner"
exit 1 unless Byebug::MinitestRunner.new.run
end
namespace :lint do
desc "Run all linters"
task all: %i[clang_format executables tabs trailing_whitespace rubocop mdl]
require_relative "tasks/linter"
desc "Run clang_format on C files"
task :clang_format do
puts "Running linter on C files"
CLangFormatLinter.new.run
end
desc "Check unnecessary execute permissions"
task :executables do
puts "Checking for unnecessary executables"
ExecutableLinter.new.run
end
desc "Check for tabs"
task :tabs do
puts "Checking for unnecessary tabs"
TabLinter.new.run
end
desc "Check for trailing whitespace"
task :trailing_whitespace do
puts "Checking for unnecessary trailing whitespace"
TrailingWhitespaceLinter.new.run
end
require "rubocop/rake_task"
RuboCop::RakeTask.new
desc "Checks markdown code style with Markdownlint"
task :mdl do
puts "Running mdl"
abort unless system("mdl", *Dir.glob("*.md"))
end
desc "Checks shell code style with shellcheck"
task :shellcheck do
puts "Running shellcheck"
abort unless system("shellcheck", *Dir.glob("bin/*.sh"))
end
end
desc "Runs lint tasks"
task lint: "lint:all"
namespace :docker do
require_relative "docker/manager"
desc "Build docker images"
task :build do
Docker::Manager.build_all
end
desc "Test docker images"
task :test do
Docker::Manager.test_all
end
desc "Push docker images to dockerhub"
task :push do
Docker::Manager.push_all
end
end
task default: %i[compile test lint]
YARD::Rake::YardocTask.new