Skip to content

Conversation

@Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Oct 16, 2025

Update license headers to use year ranges

What

  • Updated .pre-commit-config.yaml to add --use-current-year flag to the insert-license hook
  • Ran pre-commit hook to update all Python file headers from 2023 to 2023-2025

Why

  • Ensures copyright year stays current automatically
  • Prevents duplicate license headers when files are modified
  • Simplifies maintenance - hook will auto-update to 2023-2026 next year, etc.

Technical Details

Using the --use-current-year flag from Lucas-C/pre-commit-hooks, which:

  • Updates existing headers to year ranges (e.g., 20232023-2025)
  • Automatically extends ranges on file modification (e.g., 2023-20252023-2026 in 2026)
  • Maintains consistency across the codebase

@github-actions
Copy link
Contributor

Documentation preview

https://nvidia-nemo.github.io/Guardrails/review/pr-1452

Copy link
Collaborator

@tgasser-nv tgasser-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing us up to 2025, looks good.

Will the pre-commit Insert license in comments update this automatically for all source files? If not maybe a find + sed would do the same thing

@Pouyanpi
Copy link
Collaborator Author

Thanks for bringing us up to 2025, looks good.

Will the pre-commit Insert license in comments update this automatically for all source files? If not maybe a find + sed would do the same thing

Yes, after looking at the pre-commit-hooks repo I found how I should approach this (have updated the PR description). It will update the license date without any conflict on uncommitted changes.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Pouyanpi Pouyanpi changed the title chore: update LICENSE.md chore: update insert licenser pe-commit-hooks to use current year Oct 17, 2025
@Pouyanpi Pouyanpi merged commit ea92409 into develop Oct 17, 2025
9 checks passed
@Pouyanpi Pouyanpi deleted the chore/license branch October 17, 2025 08:43
Pouyanpi added a commit that referenced this pull request Oct 28, 2025
)

* chore: update LICENSE.md insertion hood to use current year

* run poetry run pre-commit run insert-license --all-files
tgasser-nv pushed a commit that referenced this pull request Oct 28, 2025
)

* chore: update LICENSE.md insertion hood to use current year

* run poetry run pre-commit run insert-license --all-files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants