Skip to content

Commit 7bdbbe7

Browse files
committed
feat(checker): New checker, doc updates.
1 parent 70cd954 commit 7bdbbe7

File tree

5 files changed

+575
-2
lines changed

5 files changed

+575
-2
lines changed

CLAUDE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ make audit
136136
# 4. Regenerate documentation
137137
make docs
138138

139-
# 5. Commit atomically
139+
# 5. (Optional) Check against system defaults
140+
make check-defaults
141+
# Review: uniqueness %, overlaps, conflicts
142+
143+
# 6. Commit atomically
140144
git add XCompose docs/*
141145
git commit -m "Add X, fix Y, update docs"
142146
```
@@ -195,6 +199,7 @@ make all # Runs validate + audit + docs
195199
- [ ] All validation passes
196200
- [ ] Documentation is comprehensive and up-to-date
197201
- [ ] CI pipeline passes
202+
- [ ] `check_system_defaults.py` shows high uniqueness (>70%)
198203
- [ ] Version tagged in git
199204

200205
---

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
#
2525
################################################################################
2626

27-
.PHONY: help validate audit docs all clean test install uninstall
27+
.PHONY: help validate audit docs all clean test install uninstall check-defaults
2828

2929
# Configuration
3030
XCOMPOSE_FILE := XCompose
3131
PYTHON := python3
3232
VALIDATOR := tools/validate_xcompose.py
3333
AUDITOR := tools/audit_xcompose_design.py
3434
GENERATOR := tools/generate_xcompose_docs.py
35+
CHECKER := tools/check_system_defaults.py
3536
DOCS_DIR := docs
3637

3738
help: ## Show this help message
@@ -55,6 +56,10 @@ audit: ## Run design quality audit
5556
@echo "==> Running design audit..."
5657
@$(PYTHON) $(AUDITOR) $(XCOMPOSE_FILE)
5758

59+
check-defaults: ## Compare against system defaults (informational)
60+
@echo "==> Comparing against system defaults..."
61+
@$(PYTHON) $(CHECKER) $(XCOMPOSE_FILE)
62+
5863
docs: ## Generate all documentation (HTML, JSON, Markdown, checklist)
5964
@echo "==> Generating documentation..."
6065
@$(PYTHON) $(GENERATOR) $(XCOMPOSE_FILE) --all
@@ -102,3 +107,7 @@ watch: ## Watch XCompose file and auto-regenerate docs (requires entr)
102107
@echo "Watching $(XCOMPOSE_FILE) for changes..."
103108
@echo "Press Ctrl+C to stop"
104109
@echo $(XCOMPOSE_FILE) | entr -c make docs
110+
111+
.PHONY: list-locales
112+
list-locales: ## List all available system Compose files
113+
@$(PYTHON) $(CHECKER) --list-locales

docs/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ <h2>The Solution</h2>
462462
<strong style="color: #f57c00;">⚠️ Work in Progress</strong><br>
463463
This project is actively developed. Mappings may change, be added, or be removed until version 1.0 is released.
464464
</div>
465+
<h2>What Symbols Can I Type?</h2>
466+
<p>
467+
See for yourself in in the <a href="xcompose_reference.html">Symbol Reference</a>.
468+
</p>
465469

466470
<h2>What's a Compose Key?</h2>
467471
<p>

tools/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This directory contains tools for validating, auditing, and documenting XCompose
99
| `validate_xcompose.py` | Syntax & conflict validation | Required before every commit |
1010
| `audit_xcompose_design.py` | Design quality analysis | Recommended for major changes |
1111
| `generate_xcompose_docs.py` | Documentation generation | Run after XCompose changes |
12+
| `check_system_defaults.py` | Compare against system defaults | Recommended before release |
1213
| `auto_tag_xcompose.py` | Bulk comment tagging | One-time or migration tool |
1314

1415
---
@@ -112,6 +113,49 @@ This directory contains tools for validating, auditing, and documenting XCompose
112113

113114
---
114115

116+
## check_system_defaults.py
117+
118+
**Purpose**: Compares custom XCompose sequences against system defaults to identify overlaps, conflicts, and unique additions.
119+
120+
**Usage**:
121+
```bash
122+
# Basic comparison
123+
./tools/check_system_defaults.py XCompose
124+
125+
# Verbose output with all sequences
126+
./tools/check_system_defaults.py XCompose --verbose
127+
128+
# Generate documentation notes for README
129+
./tools/check_system_defaults.py XCompose --notes
130+
131+
# List all available system Compose files
132+
./tools/check_system_defaults.py --list-locales
133+
134+
# Compare against specific locale
135+
./tools/check_system_defaults.py XCompose --system-file /usr/share/X11/locale/el_GR.UTF-8/Compose
136+
```
137+
138+
**Identifies**:
139+
- **Overlaps**: Sequences producing same output as system (redundant but harmless)
140+
- **Conflicts**: Sequences overriding system defaults (intentional customization)
141+
- **Unique additions**: Sequences not in system defaults
142+
143+
**Multi-Platform Features**:
144+
- Auto-detects user's current locale
145+
- Falls back to common locales (en_US.UTF-8, C)
146+
- Lists all available system Compose files
147+
- Supports comparing against any locale
148+
149+
**Output**: Analysis report with statistics, value assessment, and recommendations.
150+
151+
**Use cases**:
152+
- Before public release (verify uniqueness)
153+
- Multi-platform testing (check against different locales)
154+
- Documentation generation (explain overrides)
155+
- Quality assessment (measure value-add)
156+
157+
---
158+
115159
## auto_tag_xcompose.py
116160

117161
**Purpose**: Automatically tags XCompose comments with type classification.

0 commit comments

Comments
 (0)