An open API service indexing awesome lists of open source software.

https://github.com/frgfm/validate-python-headers

An action to validate the headers of your Python files
https://github.com/frgfm/validate-python-headers

copyright headers license python3

Last synced: 5 months ago
JSON representation

An action to validate the headers of your Python files

Awesome Lists containing this project

README

        

# Header validator for your Python files



CI Status


ruff


ruff



GitHub release (latest by date)
GitHub

This action checks the copyright and license notices in the headers of your Python files.

## Inputs

### `owner`

**Required** The copyright owner.

### `starting-year`

**Required** The starting year of your project.

### `license`

Identifier of the license for your project (cf. [SPDX identifiers](https://spdx.org/licenses/)). Default `null`.

### `folders`

The folders to inspect, separated by a comma. Default `"."`.

### `ignore-files`

The files to ignore, separated by a comma. Default `"__init__.py"`.

### `ignore-folders`

The folders to ignore, separated by a comma. Default `".github/"`.

### `license-notice`

The path to a license notice text. If license is `null`, the header will be expected to have this text as a license notice. Default `null`.

## Outputs

The list of files with header issues and the suggested format (cf. example below):
```
Your header should look like:

# Copyright (C) , Pyronear.

# This program is licensed under the Apache License 2.0.
```

## Example usages

Using an Open-source license:

```
uses: frgfm/validate-python-headers@main
with:
license: 'Apache-2.0'
owner: 'François-Guillaume Fernandez'
starting-year: 2022
ignore-files: 'version.py,__init__.py'
ignore-folders: '.github/'
```

On closed source code:

```
uses: frgfm/validate-python-headers@main
with:
license-notice: '.github/license-notice.txt'
owner: 'François-Guillaume Fernandez'
starting-year: 2022
ignore-files: 'version.py,__init__.py'
ignore-folders: '.github/'
```

## Contributing

Any sort of contribution is greatly appreciated!

You can find a short guide in [`CONTRIBUTING`](CONTRIBUTING.md) to help grow this project!

## License

Distributed under the Apache 2.0 License. See [`LICENSE`](LICENSE) for more information.