Skip to content

Commit

Permalink
Add a small script to update copyright headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Diptorup Deb committed Feb 17, 2023
1 parent 1ad75db commit 231661d
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions scripts/update_copyrights.py
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)

0 comments on commit 231661d

Please sign in to comment.