Skip to content

Commit

Permalink
fix: correct a few handles
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Sep 20, 2024
1 parent bb19365 commit b24f3b1
Show file tree
Hide file tree
Showing 2 changed files with 1,697 additions and 1,629 deletions.
84 changes: 76 additions & 8 deletions .github/generate-codeowners.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,90 @@
#!/usr/bin/env ruby

codeowners = File.open('CODEOWNERS', 'w')
unique_authors_file = File.open('unique_authors.txt', 'w')
GithubHandles = {
'<Adam Hobart>' => '',
'<Alessandra Filippi>' => '',
'<Andrey Kim>' => '',
'<Blake Huck>' => '',
'<Bruno Benkel>' => '',
'<Christopher Dilks>' => 'c-dilks',
'<Cole Smith>' => '',
'<Connor Pecar>' => '',
'<David Heddle>' => '',
'<David Payette>' => '',
'<Efrain Patrick Segarra>' => '',
'<Efrain Segarra>' => '',
'<Florian Hauenstein>' => '',
'<Francesco Bossu>' => '',
'<Francois-Xavier Girod>' => '',
'<Gagik Gavalian>' => '',
'<Giovanni Angelini>' => '',
'<Guillaume Christiaens>' => '',
'<Joseph Newton>' => '',
'<Justin Goodwill>' => '',
'<L Smith>' => '',
'<Latif Kabir>' => '',
'<Marco Contalbrigo>' => '',
'<Mathieu Ouillon>' => '',
'<Maurik Holtrop>' => '',
'<Maxime Defurne>' => '',
'<Michael Hoffer>' => '',
'<Nathan Baltzell>' => 'baltzell',
'<Nathan Harrison>' => '',
'<Nick Markov>' => '',
'<Noemie Pilleux-LOCAL>' => '',
'<Peter EJ Davies>' => '',
'<Pierre Chatagnon>' => '',
'<Rafayel Paremuzyan>' => '',
'<Raffaella De Vita>' => 'raffaelladevita',
'<Reynier Cruz Torres>' => '',
'<Rong Wang>' => '',
'<Silvia Nicolai>' => '',
'<Sylvester Joosten>' => '',
'<Tongtong Cao>' => '',
'<Vardan Gyurjyan>' => '',
'<Veronique Ziegler>' => '',
'<ajhobart>' => '',
'<colesmith>' => '',
'<cqplatt>' => '',
'<dcpayette>' => '',
'<dependabot[bot]>' => '',
'<efuchey>' => '',
'<hattawy>' => '',
'<huckb>' => '',
'<jwgibbs>' => '',
'<mariangela-bondi>' => '',
'<marmstr4>' => '',
'<mcontalb>' => '',
'<mpaolone>' => '',
'<rtysonCLAS12>' => '',
'<tongtongcao>' => '',
'<veronique>' => '',
}

unique_authors = []
codeowners = File.open('CODEOWNERS', 'w')
unknown_authors = []

file_list = `git ls-files`.split("\n")
file_list.each_with_index do |file,i|
puts "#{i+1} / #{file_list.size}"
authors = `git shortlog -s -n -- '#{file}'`.split("\n").map do |line|
"<" + line.split(' ')[1..-1].join(' ') + ">"
end
unique_authors += authors
codeowners.puts "#{file.gsub(' ','\ ')} #{authors.join(' ')}"
handles = authors.map do |author|
handle = GithubHandles[author]
if handle != ''
"@#{handle}"
else
unknown_authors << author
author
end
end
codeowners.puts "#{file.gsub(' ','\ ')} #{handles.join(' ')}"
end

unique_authors.uniq.each do |name|
unique_authors_file.puts name
unless unknown_authors.empty?
$stderr.puts "WARNING: the following authors have unknown GitHub handles:"
$stderr.puts unknown_authors.uniq.sort
end

[ codeowners, unique_authors_file ].each &:close
codeowners.close
Loading

0 comments on commit b24f3b1

Please sign in to comment.