Passed
Pull Request — main (#297)
by
unknown
01:50
created

license_generator   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 12
dl 0
loc 19
rs 10
c 0
b 0
f 0
1
from glob import glob
2
3
pincer_license = """# Copyright Pincer 2021-Present
4
# Full MIT License can be found in `LICENSE` at the project root.
5
6
"""
7
8
9
for file in glob("./pincer/**/*.py", recursive=True):
10
    if file == "./pincer/__init__.py":
11
        continue
12
13
    with open(file, "r+") as f:
14
        lines = f.readlines()
15
        if not lines[0].startswith("# Copyright Pincer 2021-Present\n"):
16
            lines.insert(0, pincer_license)
17
            f.seek(0)
18
            f.writelines(lines)
19