Thank you for considering a contribution to nerdicons! This document covers the development workflow, code style, and what to check before opening a pull request.
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -e '.[dev]'- Formatter: Ruff (
ruff format .). - Linter: Ruff (
ruff check .). - Type checking: mypy strict + pyright strict.
- Line length: 100 characters.
- Quotes: Double quotes.
- Imports: Sorted by isort via Ruff.
ruff format .
ruff check .
mypy src generator tests
pyright
pytestThe generated namespace modules and docs are checked in. After changing the generator or updating the upstream metadata:
python generator/generate.pyTo fetch the latest pinned upstream snapshot first:
python generator/generate.py --refreshTo verify generated files are up-to-date without writing (CI mode):
python generator/generate.py --checkDo not hand-edit generated icon data. Changes to the upstream snapshot must include the pinned version and a reviewed manifest/codepoint diff.
Before opening a PR, please verify:
-
ruff check .passes with no errors. -
ruff format --check .passes. -
mypy src generator testspasses. -
pyrightpasses. -
pytestpasses. - Generated files are current (
python generator/generate.py && git diff --exit-code). - Examples still run (
python examples/basic.py && python examples/lookup.py). - CHANGELOG.md is updated if the change is user-facing.
src/nerdicons/core.py— Runtime primitives (Icon,IconRegistry).src/nerdicons/cli.py— CLI argument parsing and subcommand dispatch.src/nerdicons/_tui.py— Interactive terminal browser (curses + Windows fallback).src/nerdicons/icons.py— Generated aggregator that builds theIconsregistry.src/nerdicons/{namespace}.py— Generated per-namespace icon modules.generator/— Parser, code emitter, and entry-point script.
The interactive browser uses only Python's standard curses module, so it does not add a
runtime dependency.