https://github.com/mattdibi/copyright-check
Copyright checker
https://github.com/mattdibi/copyright-check
Last synced: 3 months ago
JSON representation
Copyright checker
- Host: GitHub
- URL: https://github.com/mattdibi/copyright-check
- Owner: mattdibi
- License: mit
- Created: 2025-02-05T07:46:17.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-02-08T09:46:29.000Z (3 months ago)
- Last Synced: 2025-02-08T10:28:07.985Z (3 months ago)
- Language: Python
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# copyright-check
Copyright checker## Requirements
- [libmagic](https://pypi.org/project/python-magic/)
## Usage
```bash
usage: copyright-check [-h] [-d] -c CONFIG file [file ...]Check copyright headers
positional arguments:
file file(s) to checkoptions:
-h, --help show this help message and exit
-d, --debug Print debug information
-c, --config CONFIG set path to the config yaml fileExample usage: copyright-check -c config.yaml $(git diff --name-only) **/*.java
```## Example configuration
```yaml
# Enable or disable the copyright date check
bypass_year_check: false
# In the template the user can specify two variables: {years} and {holder}
# - {years} will match the copyright years (regex: `\d{4}(,\s\d{4})?`)
# - {holder} will match the copyright holder (regex: `[\w\s\.]+`)
template_java: |
******************************************************************************
* Copyright (c) {years} {holder} and/or its affiliates and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* {holder}
template_xml: |2
Copyright (c) {years} {holder} and/or its affiliates and othersThis program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/SPDX-License-Identifier: EPL-2.0
Contributors:
{holder}
# Ignore specific files and paths. The syntax and semantics are the same as in the .gitignore file.
ignore:
- ignore.java
```## Running tests
From the root of the project run:
```bash
uv run pytest
```