Adds or replaces header comments in source files.
Project description
sourceheaders
Adds or replaces header comments (usually containing licensing information) in source files.
Configuration
You can configure sourceheaders by placing a .sourceheaders.toml
file into
your project root.
[general]
license = "MPL-2.0"
copyright_holder = "John Doe <john.doe@example.com>"
prefer_inline = true
width = 70
[language.rust]
width = 99
Usage
Command line
You can run sourceheaders manually on the command line and pass one or more file paths.
$ sourceheaders /path/to/file.py /path/to/other/file.rs
Added header to /path/to/file.py
Replaced header in /path/to/other/file.rs
Pre-commit
sourceheaders can be used with pre-commit.
Add the following lines to your .pre-commit-config.yaml
:
- repo: https://github.com/Holzhaus/sourceheaders
rev: ""
hooks:
- id: sourceheaders
Either specify a specific hook version in the rev
field directly, or run the
this command to automatically fill in the latest version:
$ pre-commit autoupdate --repo "https://github.com/Holzhaus/sourceheaders"
Updating https://github.com/Holzhaus/sourceheaders ... updating -> <latest-version>.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sourceheaders-0.0.1.tar.gz
(17.1 kB
view hashes)
Built Distribution
Close
Hashes for sourceheaders-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c61145246b72b161bcedf1f2267eb16dae9c50583dd9652b9c334fe86c688127 |
|
MD5 | 4b2d36388c2cbe378c5e676e8039a773 |
|
BLAKE2b-256 | 9351a39d192b880a64741021e231c8b6a5312af332c53cd5661803b9329bbc23 |