Skip to content

Remove dead code: unused functions, constants, and color definitions#1836

Closed
duriantaco wants to merge 1 commit intohttpie:masterfrom
duriantaco:remove-dead-code
Closed

Remove dead code: unused functions, constants, and color definitions#1836
duriantaco wants to merge 1 commit intohttpie:masterfrom
duriantaco:remove-dead-code

Conversation

@duriantaco
Copy link
Copy Markdown

Hello, doing some cleanup here.

Here are some of the stuff we think should be cleaned up..

  1. to_help_message() in rich_help.py... Never called. Removed along with constants and helpers that only existed to support it (unpack_argument, MORE_INFO_COMMANDS, LEFT_PADDING_, LEFT_INDENT_, STYLE_METAVAR, STYLE_SWITCH, MAX_CHOICE_CHARS)
  • enable_highlighter() in rich_utils.py. Never used
  • humanize_bytes() in utils.py. Not called
  • SEPARATOR_GROUP_DATA_EMBED_ITEMS in cli/constants.py.. frozenset never referenced in any import
  • DEFAULT_SESSIONS_DIR in sessions.py... Path constant never read
  • In colors.py (BASE02, BASE00, BASE0, BASE2, BASE3, MAGENTA, VIOLET). Defined but not used anywhere else?

Dead code was identified using Skylos (https://github.com/duriantaco/skylos).

- `to_help_message()` in rich_help.py — never called; remove along with
  constants and helpers that only existed to support it (unpack_argument,
  MORE_INFO_COMMANDS, LEFT_PADDING_*, LEFT_INDENT_*, STYLE_METAVAR,
  STYLE_SWITCH, MAX_CHOICE_CHARS)
- `enable_highlighter()` in rich_utils.py — context manager never used
- `humanize_bytes()` in utils.py — function never called
- `SEPARATOR_GROUP_DATA_EMBED_ITEMS` in cli/constants.py — frozenset
  never referenced in any import or code path
- `DEFAULT_SESSIONS_DIR` in sessions.py — path constant never read
- 7 unused Solarized color class attributes in colors.py (BASE02, BASE00,
  BASE0, BASE2, BASE3, MAGENTA, VIOLET) — defined but not used in the
  styles dict or anywhere else

Dead code was identified using Skylos (https://github.com/duriantaco/skylos).
@duriantaco duriantaco closed this by deleting the head repository Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant