Skip to main content

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 🛠️

  1. Install the pre-commit package if you haven't already:

      pip install pre-commit-keyword-checker
    
  2. Add the following content to your project's .pre-commit-config.yaml file, replacing yourusername 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.

  1. 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

pre-commit-keyword-checker-1.2.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file pre-commit-keyword-checker-1.2.0.tar.gz.

File metadata

File hashes

Hashes for pre-commit-keyword-checker-1.2.0.tar.gz
Algorithm Hash digest
SHA256 a34f78ddf115a6c334b68d46b8621d66bce989ffd486e4891c233cb040d7262c
MD5 948947be2f7b81751eccbb635d7d3301
BLAKE2b-256 ed933e1ebb3f7d6d1eddcd4ce3bf29eeaf48dc6c3be6e49838b1656a526d45b8

See more details on using hashes here.

File details

Details for the file pre_commit_keyword_checker-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pre_commit_keyword_checker-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89f3ace3fa950122f6730cbee4ac868353bed3d5acc719700caa71d43b20f20d
MD5 2ccee0b787f65d26022069edfe61f502
BLAKE2b-256 374133fe3f0e0dde3b94b83249eed7cb75d2e5ef476b9777a12dcd3419a6b431

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page