Skip to content

styles: case-insensitive style registration and lookup#1223

Merged
alecthomas merged 1 commit intoalecthomas:masterfrom
jmooring:issue-1222
Mar 4, 2026
Merged

styles: case-insensitive style registration and lookup#1223
alecthomas merged 1 commit intoalecthomas:masterfrom
jmooring:issue-1222

Conversation

@jmooring
Copy link
Contributor

@jmooring jmooring commented Feb 25, 2026

Normalize style names to lowercase during registration and lookup to provide case-insensitive access across the library, CLI, and web interface.

Changes:

  • Normalize keys to lowercase in styles.Register().
  • Convert input names to lowercase in styles.Get().
  • Update cmd/chroma and cmd/chromad to use these normalized keys.
  • Add regression tests for library and CLI case-insensitivity.
  • Update CI workflow to include tests for the cmd/chroma module.
  • Update README.md to document case-insensitive style names.

Closes #1222

@jmooring jmooring force-pushed the issue-1222 branch 2 times, most recently from 11ae052 to f9dcb36 Compare February 25, 2026 08:25
@jmooring
Copy link
Contributor Author

I recognize that this may appear to be a broad approach to resolving #1222, but there are a few key reasons for the design:

  • It provides backwards compatibility, ensuring that all existing scripts and integrations continue to work regardless of how they reference style names.
  • With the exception of the recent "RPGLE" addition, Chroma has already standardized on lowercase style names. This PR simply implements that convention formally in the code to prevent future inconsistencies.
  • I've also added the first set of regression tests for the CLI and updated the CI workflow to ensure the cmd/chroma module is actually being tested moving forward.

This ensures that the library, CLI, and web interface all behave consistently.

Normalize style names to lowercase during registration and lookup to
provide case-insensitive access across the library, CLI, and web interface.

Changes:

- Normalize keys to lowercase in styles.Register().
- Convert input names to lowercase in styles.Get().
- Update cmd/chroma and cmd/chromad to use these normalized keys.
- Add regression tests for library and CLI case-insensitivity.
- Update CI workflow to include tests for the cmd/chroma module.
- Update README.md to document case-insensitive style names.

Closes alecthomas#1222
Copy link
Owner

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it!

@alecthomas alecthomas merged commit 8087957 into alecthomas:master Mar 4, 2026
2 checks passed
@jmooring jmooring deleted the issue-1222 branch March 4, 2026 15:09
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.

Rename the RPGLE style to rpgle (lowercase)

2 participants