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

Is there a way of defining a string in the hooks args instead of --license-filepath #81

Open
mikel-brostrom opened this issue Aug 5, 2023 · 2 comments

Comments

@mikel-brostrom
Copy link

This:

- repo: https://github.com/Lucas-C/pre-commit-hooks
  rev: v1.5.3
  hooks:
    - id: insert-license
      files: ./*
      args:
        - --license-filepath
        - LICENSE
        - --use-current-year

does not work for me as my LICENSE 600+ lines long and I don't want to add a txt file to the repo simply for this. Is there a way of specifying a string to be inserted? Something like

- repo: https://github.com/Lucas-C/pre-commit-hooks
  rev: v1.5.3
  hooks:
    - id: insert-license
      files: ./*
      args:
        - --license-string
        - "MyName RepoName AGPL3.0 License"
        - --use-current-year

?

@Lucas-C
Copy link
Owner

Lucas-C commented Aug 11, 2023

Hi @mikel-brostrom

No, currently this hook does not offer such feature,
but you are welcome to contribute such new option
through a Pull Request with some unit tests 😊

@peterjc
Copy link

peterjc commented Aug 29, 2024

See https://github.com/johannsdg/pre-commit-license-headers for an example with a multi-line license defined in the pre-commit YAML file.

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

No branches or pull requests

3 participants