Skip to content

Latest commit

 

History

History
80 lines (59 loc) · 2.28 KB

File metadata and controls

80 lines (59 loc) · 2.28 KB

Contributing

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.

Development setup

python -m venv .venv
source .venv/bin/activate   # or .venv\Scripts\activate on Windows
pip install -e '.[dev]'

Code style

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

Running checks

ruff format .
ruff check .
mypy src generator tests
pyright
pytest

Regenerating icon data

The generated namespace modules and docs are checked in. After changing the generator or updating the upstream metadata:

python generator/generate.py

To fetch the latest pinned upstream snapshot first:

python generator/generate.py --refresh

To verify generated files are up-to-date without writing (CI mode):

python generator/generate.py --check

Do not hand-edit generated icon data. Changes to the upstream snapshot must include the pinned version and a reviewed manifest/codepoint diff.

Pull request checklist

Before opening a PR, please verify:

  • ruff check . passes with no errors.
  • ruff format --check . passes.
  • mypy src generator tests passes.
  • pyright passes.
  • pytest passes.
  • 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.

Architecture notes

  • 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 the Icons registry.
  • 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.