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

Create pre-commit hook to add license header to all files #7

Closed
klmcadams opened this issue Jul 5, 2023 · 0 comments · Fixed by #8
Closed

Create pre-commit hook to add license header to all files #7

klmcadams opened this issue Jul 5, 2023 · 0 comments · Fixed by #8
Assignees
Labels
enhancement New features or code improvements

Comments

@klmcadams
Copy link
Contributor

klmcadams commented Jul 5, 2023

📝 Description of the feature

pre-commit hook reads the license file and adds the header to all files. If the license file is changed, then it should update all the files with the new header.

💡 Steps for implementing the feature

Command for adding header to file based on our template

reuse annotate --year 2023 --copyright-style string-c --merge-copyright --template=ansys -l MIT -c "ANSYS, Inc." --skip-unrecognised .\src\ansys\templates_init_.py

Command for running pre-commit hooks on demand: pre-commit run --all-files

Command for installing pre-commit on your repository: pre-commit install

For running pre-commit you need to have a file at the root level of your repository called .pre-commit-config.yaml, where the config of the different tools is defined.

🔗 Useful links and references

Pre-commit documentation: https://pre-commit.com/
Pre-commit hooks repository: https://github.com/pre-commit/pre-commit-hooks
Reuse tool: https://reuse.readthedocs.io/en/stable/usage.html
Repo using reuse: https://github.com/ansys/ansys-templates --> Main points to look at: LICENSES folder, .reuse folder

@klmcadams klmcadams added the enhancement New features or code improvements label Jul 5, 2023
@klmcadams klmcadams self-assigned this Jul 5, 2023
@klmcadams klmcadams linked a pull request Jul 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant