Skip to main content

A Python linter that flags "naughty" words and non-inclusive language to ensure code is HR compliant

Project description

Karen Inspect - The Python HR Linter 🤖📝

Karen Inspect is a Python linter designed to make code "HR-approved" by catching "naughty" words, offensive language, and enforcing strict rules that would make an overzealous HR representative proud.

Features

  • Naughty Word Detection: Flags "non-inclusive" or "inappropriate" terms like whitelist, blacklist, master, slave, and more.
  • Immediate Termination Offenses: Some words, like stupid or lazy, result in "IMMEDIATE TERMINATION" warnings.
  • Bless Your Heart Lint Rules:
    • Function names must be complete sentences with punctuation.
    • No variable names containing "temp"—because everything should be permanent!
    • Single-letter variable names are lazy. Use more descriptive names.
    • Pythonic idioms like list comprehensions? Too clever for their own good—avoid them!
  • Karen-Like Comments: Customizable, sarcastic feedback mimicking a micromanaging HR representative.

Example Violations

Violations found in noncompliant_py_file.py:
Line 3: print("This is a dummy function with a whitelist.")
    Found 'whitelist' -> Rule: Karen prefers more inclusive language. Use "allowlist" instead. (WARNING)

Line 7: print("My boss is stupid, and I feel lazy after my lunch break.")
    Found 'lunch break' -> Rule: You can have a break, but don’t mention it. (WARNING)
    Found 'lazy' -> Rule: We don’t tolerate calling anyone lazy here. (IMMEDIATE TERMINATION)
    Found 'stupid' -> Rule: Calling things or people stupid is unacceptable. (IMMEDIATE TERMINATION)

Installation

To install the linter in your environment:

git clone https://github.com/amshamah419/Karen-Inspect
cd karen-inspect
pip install .

Usage

Run the linter from the command line, specifying the Python file you want to inspect:

karen-inspect path/to/your/python_file.py

Bless Your Heart's

The linter supports rules which HR has learned over the years, such as:

  • Function Naming: Must be complete sentences with proper punctuation.
  • Avoid List Comprehensions: Enforces verbose, non-Pythonic code.
  • No Temporary Variables: Flags any variable with the word temp.

Contributing

Contributions, feature requests, and complaints (from "Karen") are welcome!

Feel free to open an issue or submit a pull request.

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

karen_inspect-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

karen_inspect-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file karen_inspect-0.1.0.tar.gz.

File metadata

  • Download URL: karen_inspect-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for karen_inspect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6d3750977246476235a476e7f93417adf5f387ca85c4c361e5b7634c1b751c56
MD5 806381692ebe504b950dc6fe1a825b83
BLAKE2b-256 ca9d0018a799e1136e7d1668b51422b43d2119cfdef6682a160a3c82add38d2b

See more details on using hashes here.

File details

Details for the file karen_inspect-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for karen_inspect-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4b0ff3c01f0d7ef584fc3d81f8d743a76490b095f17d244c252a75dec4a9d0c
MD5 0bef99a98573d3491927a9bdab47e0d8
BLAKE2b-256 f6f6f63e06ec35634010af68ae111c6af0740248a304dbcf18ce2cc788c027fe

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