Skip to content

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

Open

Description

@mikel-brostrom

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

?

Activity

  1. Lucas-C commented on Aug 11, 2023

    @Lucas-C
    Owner

    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 😊

  2. peterjc commented on Aug 29, 2024

    @peterjc

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions