-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warn projects with pis who dont exist
- Loading branch information
Showing
7 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Linters | ||
module Default | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'rainbow' | ||
require 'linters/default' | ||
require 'linters/projects' | ||
require 'vars' | ||
require 'yaml' | ||
|
||
namespace :lint do | ||
desc 'lint the fetched project yaml data' | ||
task :projects do | ||
categories = %w(DH Seed Grant Recipient Grad Fellowship Project Other) | ||
people = YAML.load_file(Vars::People.yml_file).map { |h| h['pid'] } | ||
projects = YAML.load_file Vars::Projects.yml_file | ||
|
||
projects.each do |project| | ||
project.dig('pis').each do |pi| | ||
puts Rainbow("WARNING: Project '#{project['pid']}' references nonexisting person '#{pi}'.").magenta unless people.include? pi | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters