-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
1,697 additions
and
1,629 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 |
---|---|---|
@@ -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 |
Oops, something went wrong.