A pre-commit hook for checking specified keywords in the files being committed.
Project description
Pre-commit Keyword Checker 📝✅
Welcome to the Pre-commit Keyword Checker! This handy pre-commit hook checks for specified keywords in the files being committed. It offers file exclusion options and customizable keyword lists to make sure your commits stay keyword-free!
Installation 🛠️
-
Install the pre-commit package if you haven't already:
pip install pre-commit-keyword-checker
-
Add the following content to your project's
.pre-commit-config.yaml
file, replacingyourusername
with your GitHub username:
repos:
- repo: https://github.com/AliYmn/pre-commit-keyword-checker
rev: master
hooks:
- id: check-keywords
args: ["--keywords", "KEYWORD1", "KEYWORD2", "--exclude-files", "file2.txt"]
Replace KEYWORD1, KEYWORD and file1.txt with your desired keywords and excluded files.
-
Install the pre-commit hook to your project:
pre-commit install
And you're all set! 🎉
Usage
Once installed, the keyword-checking pre-commit hook will be run whenever you commit changes in your project. If any of the specified keywords are found in the files being committed (excluding the specified files), the commit will be blocked, and the script will display a list of keyword errors.
You can also run the pre-commit hook manually:
pre-commit run check-keywords
And you're good to go! 🚀
Configuration
--keywords: A list of keywords to search for in the files being committed. If this argument is not provided or left empty, the script will exit without checking the files.
--exclude-files: A list of files to exclude from the keyword check.
Project details
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 pre-commit-keyword-checker-1.4.0.tar.gz
.
File metadata
- Download URL: pre-commit-keyword-checker-1.4.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f2ce5813fbb4c72e1317d173f97000f9ebb5414ac9c7d85882c3f9642ae396a |
|
MD5 | 448295afa823be3208253a9338ffdbe3 |
|
BLAKE2b-256 | de0411d420c8002a99d96b0cf1908fb1db5239cf173203be8ab702e7b8a82198 |
File details
Details for the file pre_commit_keyword_checker-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: pre_commit_keyword_checker-1.4.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 224c3a9a4f3e8b4c6570b22910940c746baf9e098b50b52edc1911497edf3940 |
|
MD5 | b4af2702d761796d421de2f4d68b696f |
|
BLAKE2b-256 | a779b42653151398a64e36c33e4c959f538a51d8aa8fd5ff12962e348a529172 |