blob: f6d8944c5a13764826d718b972053cbd55bb9e33 (
plain)
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
|
# frozen_string_literal: true
namespace :gitlab do
namespace :docs do
COLOR_CODE_RESET = "\e[0m"
COLOR_CODE_RED = "\e[31m"
COLOR_CODE_GREEN = "\e[32m"
desc "Generate deprecation list from individual files"
task :compile_deprecations do
require_relative '../../../../tooling/docs/deprecation_handling'
path = Rails.root.join("doc/update/deprecations.md")
File.write(path, Docs::DeprecationHandling.new('deprecation').render)
puts "#{COLOR_CODE_GREEN}INFO: Deprecations compiled to #{path}.#{COLOR_CODE_RESET}"
end
desc "Check that the deprecation documentation is up to date"
task :check_deprecations do
require_relative '../../../../tooling/docs/deprecation_handling'
path = Rails.root.join("doc/update/deprecations.md")
contents = Docs::DeprecationHandling.new('deprecation').render
doc = File.read(path)
if doc == contents
puts "#{COLOR_CODE_GREEN}INFO: Deprecations documentation is up to date.#{COLOR_CODE_RESET}"
else
warn <<~EOS
#{COLOR_CODE_RED}ERROR: Deprecations documentation is outdated!#{COLOR_CODE_RESET}
To update the deprecations documentation, either:
- Run `bin/rake gitlab:docs:compile_deprecations` and commit the changes to this branch.
- Have a technical writer resolve the issue.
EOS
abort
end
end
end
end
|