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

feat: Add pre-commit.com hook config to allow easy usage with pre-commit configs #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rickeylev
Copy link

This allows easily using addlicense with pre-commit.com hook configs to automatically run
when committing.

An example example .pre-commit-config.yaml for a user would look like:

- repo: https://github.com/google/addlicense
    rev: <git tag>
    hooks:
      - id: addlicense
        args: [-l, apache, -c, "Copyright Owner"]

And under the hood, pre-commit will go install the addlicense program and run it on the affected files with the specified args.

This allows easily using addlicense with pre-commit hooks by adding e.g.

```
- repo: https://github.com/google/addlicense
    rev: <version>
    hooks:
      - id: addlicense
```

to their `.pre-commit-config.yaml` file.
@Spill-Tea
Copy link

I was just going to create a pull request for the same thing. It would be nice to be able to use addlicense repo as a pre-commit hook, instead of creating a mirror fork to maintain independently. Right now, I am just hacking things and injecting my own .pre-commit-hooks.yaml file on the downloaded source after installing with pre-commit to at least support locally.

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.

None yet

2 participants