-
Notifications
You must be signed in to change notification settings - Fork 128
Add Copilot encoding instructions banning non-ASCII/emoji characters #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,24 +14,20 @@ description: "CLI Design Guidelines for visual output, styling, and user experie | |||||||||||||||||||||||||||||||||||||||||||||||
| - Wrap Rich imports in try/catch with colorama fallbacks | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| ### Command Help Text | ||||||||||||||||||||||||||||||||||||||||||||||||
| - **ALWAYS** include contextual emojis in command help strings | ||||||||||||||||||||||||||||||||||||||||||||||||
| - Format: `help="🚀 Initialize a new APM project"` | ||||||||||||||||||||||||||||||||||||||||||||||||
| - Use semantic emojis that match the command purpose | ||||||||||||||||||||||||||||||||||||||||||||||||
| - Keep command help strings plain ASCII — no emojis | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - Keep command help strings plain ASCII — no emojis | |
| - Keep command help strings plain ASCII - no emojis |
Copilot
AI
Mar 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The symbol semantics described here don't fully match the current STATUS_SYMBOLS mapping (e.g. STATUS_SYMBOLS['success'] and ['sparkles'] map to [*] in src/apm_cli/utils/console.py, but this section frames [*] as "action / configuration / processing" while [+] is "success"). To avoid confusing contributors (and leading to inconsistent output), consider aligning this table with the actual mapping or explicitly standardizing which keys should be used for success vs. action going forward.
| - Use `STATUS_SYMBOLS` dict for consistent ASCII bracket notation: | |
| - `[+]` success / confirmed | |
| - `[>]` running / execution / progress | |
| - `[*]` action / configuration / processing | |
| - `[i]` information / tips | |
| - `[#]` lists / metrics | |
| - `[!]` warnings | |
| - `[x]` errors | |
| - Use helper functions: `_rich_success()`, `_rich_error()`, `_rich_info()`, `_rich_warning()` | |
| - Pass the appropriate key from `STATUS_SYMBOLS` via the `symbol=` parameter (e.g. `symbol="check"`, `symbol="warning"`) | |
| - Use `STATUS_SYMBOLS` dict for consistent ASCII bracket notation. | |
| - Always pass **semantic keys** (not raw symbols) to `STATUS_SYMBOLS`. | |
| - Recommended keys and meanings: | |
| - `success`: completed / confirmed operations (currently renders as `[*]`) | |
| - `sparkles`: highlight / "nice" output (alias of `success`) | |
| - `action`: action / configuration / processing | |
| - `running`: running / execution / progress | |
| - `info`: information / tips | |
| - `list`: lists / metrics | |
| - `warning`: warnings | |
| - `error`: errors | |
| - Use helper functions: `_rich_success()`, `_rich_error()`, `_rich_info()`, `_rich_warning()` | |
| - Pass the appropriate key from `STATUS_SYMBOLS` via the `symbol=` parameter (e.g. `symbol="success"`, `symbol="warning"`) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| --- | ||
| applyTo: "**" | ||
| description: "Cross-platform encoding rules — keep all source and CLI output within printable ASCII" | ||
| --- | ||
|
|
||
| # Encoding Rules | ||
|
|
||
| ## Constraint | ||
|
|
||
| All source code files and CLI output strings must stay within **printable ASCII** (U+0020–U+007E). | ||
|
|
||
| Do NOT use: | ||
| - Emojis (e.g. `🚀`, `✨`, `❌`) | ||
| - Unicode box-drawing characters (e.g. `─`, `│`, `┌`) | ||
| - Em dashes (`—`), en dashes (`–`), curly quotes (`"`, `"`, `'`, `'`) | ||
|
||
| - Any character outside the ASCII range (codepoint > U+007E) | ||
|
|
||
| **Why**: Windows `cp1252` terminals raise `UnicodeEncodeError: 'charmap' codec can't encode character` for any character outside cp1252. Keeping output within ASCII guarantees identical behaviour on every platform without dual-path fallback logic. | ||
|
|
||
| ## Status symbol convention | ||
|
|
||
| Use ASCII bracket notation consistently across all CLI output, help text, and log messages: | ||
|
|
||
| | Symbol | Meaning | | ||
| |--------|----------------------| | ||
| | `[+]` | success / confirmed | | ||
| | `[!]` | warning | | ||
| | `[x]` | error | | ||
| | `[i]` | info | | ||
| | `[*]` | action / processing | | ||
| | `[>]` | running / progress | | ||
|
|
||
| These map directly to the `STATUS_SYMBOLS` dict in `src/apm_cli/utils/console.py`. | ||
|
Comment on lines
+20
to
+33
|
||
|
|
||
| ## Scope | ||
|
|
||
| This rule applies to: | ||
| - Python source files (`*.py`) | ||
| - CLI help strings and command output | ||
| - Markdown documentation and instruction files under `.github/` | ||
| - Shell scripts and CI workflow files | ||
|
|
||
| Exception: binary assets and third-party vendored files are excluded. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added encoding rule includes a non-ASCII en dash in
U+0020–U+007E. Since the rule requires printable ASCII only, consider changing this toU+0020-U+007Eto keep the instructions themselves ASCII-safe.