Add text (like legal text) to the top of code without breaking it.
Project description
Text Prepender
Created in mind to add Legal Text to the top of code
text-prepender recursively goes through a specified directory/list of files, and adds text to the top of supported filetypes. If there is a filetype that you want to add/know how to add, please make a pull request!
Parameters
Optional parameters:
Command Line | Input | Description |
---|---|---|
-h, --help | Get description of text-prepender | |
-p, --path | dirpath | The path to the directory which text-prepender will start at (default: '.') |
-t, --text-file | filepath | The path to the file which text-prepender will start at (default: NOTICE) |
-i, --extra-ignores | space delimited list | Additional file paths/names to ignore. Ex. (-i file1 path1 path2) |
-v, --enable-verbose | Flag to turn on verbose logging to list skipped files at the end |
To Run:
# run on all files in current directory
text-prepender
# text-prepender --path path/to different directory
or
# run on a specific set of files
text-prepender file1 path/to/file2
text-prepender --text-file path/to/file
pre-commit
If you'd like text-prepender to be run automatically when making changes to files in your Git repository, you can install pre-commit and add the following text to your repositories' .pre-commit-config.yaml
:
repos:
- repo: https://github.com/dontirun/text-prepender
rev: v0.1.0 # The version of text-prepender
hooks:
- id: text-prepender
# args:
# - '--text-file'
# - 'NOTICE'
Manual Build
- Clone the repo
- Build the package
pip install build
python -m build
- Install the latest version of the package
- whl
pip install dist/text_prepender-x.x.x-py3-none-any.whl
- .tar.gz
pip install dist/text-prepender-x.x.x.tar.gz
- whl
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
text-prepender-0.1.0.tar.gz
(7.8 kB
view hashes)
Built Distribution
Close
Hashes for text_prepender-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5c18ed34a26200eacd0dc1e934b9f287628a11ccf8f0f986a382a2734d9394f |
|
MD5 | 580aed63326bfd69aaf82ee0f7d969a7 |
|
BLAKE2b-256 | 90384b8aab2d0b871ce0545d20272752558e60f59bcd306727c2cf99a5b4928a |