-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathRakefile
52 lines (41 loc) · 1.18 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
require_relative "lib/validate_repos"
begin
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
rescue LoadError
# no rspec available
end
begin
require "jsonlint/rake_task"
JsonLint::RakeTask.new do |t|
t.paths = %w[
*.json
]
end
rescue LoadError
# no jsonlint available
end
begin
require "rubocop/rake_task"
RuboCop::RakeTask.new
rescue LoadError
# no rubocop available
end
desc "Verify that GOVUK repos are tagged #govuk"
task :verify_repo_tags do
validator = ValidateRepos.new
untagged_message = <<~UNTAGGED
The following repos in the repos.yml file in govuk-developer-docs do not have the govuk tag on GitHub:
UNTAGGED
falsely_tagged_message = <<~FALSETAG
The following repos have the govuk tag on GitHub but are not in the repos.yml file in govuk-developer-docs:
FALSETAG
puts "#{untagged_message}\n#{validator.untagged_repos}" unless validator.untagged_repos.empty?
puts "#{falsely_tagged_message}\n#{validator.falsely_tagged_repos}" unless validator.falsely_tagged_repos.empty?
exit 1 unless validator.untagged_repos.empty? && validator.falsely_tagged_repos.empty?
end
task default: %i[
jsonlint
rubocop
spec
]