⭐️ Thanks everyone who has starred the project, it means a lot!
Install from PyPI by clicking the badge above.
View the source code on GitHub
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.
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 (
regexandemojirequired).
pip install flake8-no-emojiRun normally via flake8:
flake8 appflake8 --select=EMOExample output:
/example.py:3:10: EMO001 Emoji detected in code
You can configure categories to ignore or allow exclusively.
flake8 --ignore-emoji-types=PEOPLE,FOODThis ignores emojis in the PEOPLE and FOOD categories, but still reports
others.
flake8 --only-emoji-types=FLAGSThis only reports FLAGS emojis, ignoring everything else.
(Note: only takes precedence over ignore.)
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- PEOPLE 👩 👨 😀
- NATURE 🌳 🐶 🌸
- FOOD 🍕 🍔 🍎
- ACTIVITY ⚽ 🎮 🎭
- TRAVEL
✈️ 🚗 🚀 - OBJECTS 💻 📱 📚
- SYMBOLS ❤️ ☮️ ✔️
- FLAGS 🇺🇸 🇯🇵 🏳️🌈
- OTHER (fallback if no match)
- EMO001 — Emoji detected in code.
Clone and install in editable mode:
git clone https://github.com/AlgorithmAlchemy/flake8-no-emoji
cd flake8-no-emoji
pip install -e .[dev]
pytestMIT License © 2025 AlgorithmAlchemy