Skip to content

Commit

Permalink
Check dups in data files. (#76)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored Oct 9, 2023
1 parent 424f80a commit 69f056b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/project
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module Bin
pre do |global_options, _command, _options, _args|
GitHub::Progress.enabled = global_options['quiet'] ? false : true

GitHub::Data.check_dups!

if global_options['vcr-cassette-name']
require 'webmock'
WebMock.enable!
Expand Down
8 changes: 8 additions & 0 deletions lib/github/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ def students
@students ||= load_list(STUDENTS)
end

def check_dups!
%i[members contractors students external_users].combination(2).each do |l, r|
send(l).intersection(send(r)).each do |user|
warn "WARNING: #{user} is found in both #{l} and #{r}"
end
end
end

def bots
@bots ||= load_list(BOTS)
end
Expand Down

0 comments on commit 69f056b

Please sign in to comment.