Lucas-C/pre-commit-hooks

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

Opened this issue · 2 comments

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

?

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 😊

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