{"id":19946094,"url":"https://github.com/quantco/pre-commit-mirrors-insert-license","last_synced_at":"2025-03-01T14:16:06.097Z","repository":{"id":211255173,"uuid":"728230894","full_name":"Quantco/pre-commit-mirrors-insert-license","owner":"Quantco","description":"Pre-commit hook to insert a license disclaimer as a header comment in source files.","archived":false,"fork":false,"pushed_at":"2025-02-03T07:55:52.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-02-18T18:51:39.114Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quantco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-06T14:01:58.000Z","updated_at":"2025-02-03T07:55:54.000Z","dependencies_parsed_at":"2024-01-08T09:34:33.881Z","dependency_job_id":"fa2c4534-3123-41a4-a1a3-ffa99f56aafa","html_url":"https://github.com/Quantco/pre-commit-mirrors-insert-license","commit_stats":null,"previous_names":["quantco/pre-commit-insert-license","quantco/pre-commit-mirrors-insert-license"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpre-commit-mirrors-insert-license","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpre-commit-mirrors-insert-license/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpre-commit-mirrors-insert-license/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpre-commit-mirrors-insert-license/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quantco","download_url":"https://codeload.github.com/Quantco/pre-commit-mirrors-insert-license/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241374539,"owners_count":19952545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T00:28:16.680Z","updated_at":"2025-03-01T14:16:06.080Z","avatar_url":"https://github.com/Quantco.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# insert-license-header pre-commit hook\n\npre-commit hook of insert-license-header with conda as a `language` / package manager.\n\nFor pre-commit: see [here](https://github.com/pre-commit/pre-commit)\n\nFor insert-license-header: see [here](https://github.com/thomasmarwitz/insert-license-header)\n\n## Using insert-license-header with pre-commit and conda:\n\nAdd this to your `.pre-commit-config.yaml`\n\n```yaml\n - repo: https://github.com/quantco/pre-commit-mirrors-insert-license-header\n   rev: ''  # Use the sha / tag you want to point at\n   hooks:\n     - id: insert-license-header-conda\n```\n\n\u003e [!WARNING]\n\u003e In order for this hook to work properly, ensure that the entire git history is fetched during `pre-commit-checks`.\n\nThis hook uses our license header by default.\n\nHowever, you can overwrite this default header by first creating your own base64 encoded string:\n```\n$ echo \"Copyright (C) 2042, PearCorp, Inc.\\nSPDX-License-Identifier: LicenseRef-PearCorp\" | base64\nQ29weXJpZ2h0IChDKSAyMDQyLCBQZWFyQ29ycCwgSW5jLgpTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogTGljZW5zZVJlZi1QZWFyQ29ycAo=\n```\nAnd then supplying it to the hook:\n```\n[...]\n- id: insert-license\n        types: [python]\n        args:\n          - --license-base64\n          - \"Q29weXJpZ2h0IChDKSAyMDQyLCBQZWFyQ29ycCwgSW5jLgpTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogTGljZW5zZVJlZi1QZWFyQ29ycAo=\"\n          - --dynamic-years\n          - --comment-style\n          - \"#\"\n```\n\nOther comment styles:\nFor Java / Javascript / CSS/ C / C++ (multi-line comments) set: `/*| *| */`\nFor Java / Javascript / C / C++ (single line comments) set `//`\nFor HTML files: `\u003c!--|  ~|  --\u003e`\n\nTo remove all license headers, temporarily add the `--remove-header` arg in\nyour `.pre-commit-config.yaml`. Run the hook on all files: `pre-commit run insert-license -a`.\n\nFor more configuration options see the conda-packaged tool [insert-license-header](https://github.com/thomasmarwitz/insert-license-header) that exposes the `insert-license-header` executable, the original repository [Lucas-C/pre-commit-hooks](https://github.com/Lucas-C/pre-commit-hooks) and [Pre-Commit](https://pre-commit.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantco%2Fpre-commit-mirrors-insert-license","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantco%2Fpre-commit-mirrors-insert-license","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantco%2Fpre-commit-mirrors-insert-license/lists"}