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
Built Distribution
File details
Details for the file text-prepender-0.1.0.tar.gz
.
File metadata
- Download URL: text-prepender-0.1.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79eb25ea3f2022f6c8a4da36219ee116669c312602dceb429ade8f3b134ce4e5 |
|
MD5 | e2c9defdc8ec053849f2f5d8d80f376a |
|
BLAKE2b-256 | ef81b42dc7faa4b05a926d8726e295af940f7e64ee96235fde275bf402c425ba |
File details
Details for the file text_prepender-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: text_prepender-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5c18ed34a26200eacd0dc1e934b9f287628a11ccf8f0f986a382a2734d9394f |
|
MD5 | 580aed63326bfd69aaf82ee0f7d969a7 |
|
BLAKE2b-256 | 90384b8aab2d0b871ce0545d20272752558e60f59bcd306727c2cf99a5b4928a |