Skip to main content

A Flake8 plugin that detects emojis in Python source code

Project description

flake8-no-emoji

⭐️ Thanks everyone who has starred the project, it means a lot!

PyPI version Install from PyPI by clicking the badge above.

GitHub
View the source code on GitHub

Downloads License

Flake8 plugin that detects and reports any emoji characters in Python source code. Helps keep your codebase clean, consistent, and free from unwanted Unicode emojis.


Features

Note: Do not set the same category in both --ignore-emoji-types and --only-emoji-types, as only takes precedence over ignore.

  • Scans Python files for all Unicode emoji characters (including multi-codepoint clusters).

  • Raises a linting error (EMO001) when emojis are found.

  • Supports filtering by emoji categories:

    • --ignore-emoji-types=PEOPLE,FOOD
    • --only-emoji-types=FLAGS
  • Works seamlessly with Flake8 and pre-commit hooks.

  • Lightweight and dependency-minimal (regex and emoji required).


Installation

pip install flake8-no-emoji

Usage

Run normally via flake8:

flake8 app
flake8 --select=EMO

Example output:

/example.py:3:10: EMO001 Emoji detected in code

Configuration

You can configure categories to ignore or allow exclusively.

Ignore certain categories

flake8 --ignore-emoji-types=PEOPLE,FOOD

This ignores emojis in the PEOPLE and FOOD categories, but still reports others.

Allow only specific categories

flake8 --only-emoji-types=FLAGS

This only reports FLAGS emojis, ignoring everything else. (Note: only takes precedence over ignore.)


Example (with pre-commit)

Add to .pre-commit-config.yaml:

repos:
  - repo: https://github.com/AlgorithmAlchemy/flake8-no-emoji
    rev: v0.2.6
    hooks:
      - id: flake8
        additional_dependencies: [ flake8-no-emoji ]

Run:

pre-commit run --all-files

Categories Supported

  • PEOPLE 👩 👨 😀
  • NATURE 🌳 🐶 🌸
  • FOOD 🍕 🍔 🍎
  • ACTIVITY ⚽ 🎮 🎭
  • TRAVEL ✈️ 🚗 🚀
  • OBJECTS 💻 📱 📚
  • SYMBOLS ❤️ ☮️ ✔️
  • FLAGS 🇺🇸 🇯🇵 🏳️‍🌈
  • OTHER (fallback if no match)

Error Codes

  • EMO001 — Emoji detected in code.

Development

Clone and install in editable mode:

git clone https://github.com/AlgorithmAlchemy/flake8-no-emoji
cd flake8-no-emoji
pip install -e .[dev]
pytest

License

MIT License © 2025 AlgorithmAlchemy

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

flake8_no_emoji-0.2.6.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_no_emoji-0.2.6-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file flake8_no_emoji-0.2.6.tar.gz.

File metadata

  • Download URL: flake8_no_emoji-0.2.6.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for flake8_no_emoji-0.2.6.tar.gz
Algorithm Hash digest
SHA256 e4b76a2d2fa05f1042500c4d6cd28245ea533b28911a4f34697eb9fe547b8995
MD5 035e5c4b7c879cc1da7c6c33a17cbe9b
BLAKE2b-256 8b86d207375d5d5db89ebff1d1c33ffd7b6564ef2bfaa05052a0fac1231ae3f2

See more details on using hashes here.

File details

Details for the file flake8_no_emoji-0.2.6-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_no_emoji-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cca58a3962d1e69db8cfc54ad870604360b004553f62e3dcfa3a014c55642e7a
MD5 73814d0696d8cd9b6efef5fcd261cc3b
BLAKE2b-256 203f4cb154962d8510f5f23be77adf7b84f30c2b2d8e7e72f6551e95ff8edce2

See more details on using hashes here.

Supported by

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