-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a small script to update copyright headers.
- Loading branch information
Diptorup Deb
committed
Feb 17, 2023
1 parent
1ad75db
commit 231661d
Showing
1 changed file
with
33 additions
and
0 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,33 @@ | ||
import os | ||
import subprocess | ||
|
||
|
||
def update_copyrights(root_dir, year): | ||
for folder, _, files in os.walk(root_dir): | ||
for filename in files: | ||
if filename[0] != "." and os.path.splitext(filename)[1] in [ | ||
".py", | ||
".h", | ||
".c", | ||
".cpp", | ||
]: | ||
filePath = os.path.abspath(os.path.join(folder, filename)) | ||
args = [ | ||
"annotate", | ||
"--copyright=Intel Corporation", | ||
"--license=Apache-2.0", | ||
"--year", | ||
str(year), | ||
"--merge-copyrights", | ||
filePath, | ||
] | ||
subprocess.check_call( | ||
["reuse", *args], | ||
shell=False, | ||
) | ||
|
||
|
||
path = os.path.dirname(os.path.realpath(__file__)) | ||
source_path = os.path.dirname(path) | ||
|
||
update_copyrights(source_path + "/numba_dpex", 2023) |