Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adjust add-license-headers script to work with reuse 4.0.3 #211

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/211.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chore: adjust add-license-headers script to work with reuse 4.0.3
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [
"setuptools>=42.0",
"GitPython==3.1.43",
"Jinja2==3.1.4",
"reuse==3.0.2",
"reuse==4.0.3",
"requests==2.32.3",
"semver==3.0.2",
"toml==0.10.2",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def run(self):
"GitPython==3.1.43",
"importlib-metadata==8.2.0",
"Jinja2==3.1.4",
"reuse==3.0.2",
"reuse==4.0.3",
"requests==2.32.3",
"semver==3.0.2",
"toml==0.10.2",
Expand Down
8 changes: 5 additions & 3 deletions src/ansys/pre_commit_hooks/add_license_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def set_lint_args(parser: argparse.ArgumentParser) -> argparse.Namespace:
parser.add_argument("--ignore_license_check", action="store_true")
parser.add_argument("--parser")
parser.add_argument("--no_multiprocessing", action="store_true")
lint.add_arguments(parser)

# Option for printing lint output
mutex_group = parser.add_mutually_exclusive_group()
mutex_group.add_argument("-q", "--quiet", action="store_true")

return parser.parse_args()

Expand Down Expand Up @@ -241,7 +244,7 @@ def set_header_args(
args.year = [current_year]
else:
args.year = [int(start_year), current_year]
args.copyright_style = "string-c"
args.copyright_prefix = "string-c"
args.copyright = [copyright]
args.merge_copyrights = True
args.template = template
Expand Down Expand Up @@ -697,7 +700,6 @@ def find_files_missing_header() -> int:
# year, style, copyright-style, template, exclude-year, merge-copyrights, single-line,
# multi-line, explicit-license, force-dot-license, recursive, no-replace,
# skip-unrecognized, and skip-existing
# header.add_arguments(parser)
_annotate.add_arguments(parser)

# Link the default template and/or license from the assets folder to your git repo.
Expand Down
3 changes: 1 addition & 2 deletions tests/test_reuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ def test_start_year_same_as_current(tmp_path: pytest.TempPathFactory):
count = 0
for line in file:
count += 1
# Assert the copyright line's time range is
# from 2023 to the current year
# Assert the copyright line's time range is from 2023 to the current year
if count == 1:
assert f"Copyright (C) {dt.today().year} ANSYS, Inc." in line
if count > 1:
Expand Down
Loading