refactor: Phase 1 - Parser refactoring and command syntax unification#7
Open
refactor: Phase 1 - Parser refactoring and command syntax unification#7
Conversation
Add script and documentation for running tests locally before push to avoid CI failures. This replicates GitHub Actions checks locally. Changes: - Add scripts/test-local.sh for one-command local testing - Document testing workflow in CLAUDE.md - Include ruff, black, pytest, and mypy checks Note: Windows-specific tests cannot be run locally on macOS
Remove backward compatibility for implicit static: protocol.
The static: protocol is now mandatory for all static file includes.
Changes:
- include.py: Return 'unknown' protocol instead of 'static' for lines without explicit protocol
- Updated 4 tests to use explicit static: syntax
- Renamed test_modifier_without_protocol_uses_static to test_modifier_without_protocol_errors
Breaking change: Files using `{path}` must now use `static: {path}`
Related to Issue #6
… 1.2) Unify terminology to use "command" everywhere, eliminating the distinction between "modifiers" and "protocols" from user perspective. Internally, maintain two categories: - SOURCE_COMMANDS: fetch data (static, cli, glob) - TRANSFORM_COMMANDS: transform content (expand, tldr, translate) Changes: - Rename PROTOCOLS → SOURCE_COMMANDS - Rename MODIFIERS → TRANSFORM_COMMANDS - Update all docstrings and comments to use "command" terminology - Change error message from "Unknown protocol" to "Unknown command" - Update test expectations for new error message Related to Issue #6, Decision #2
Rename the 'expand' transform command to 'render' for clarity.
The render command recursively processes included content.
Changes:
- TRANSFORM_COMMANDS: "expand" → "render"
- Method: _expand_content → _render_content
- All docstrings and examples updated
- All test files updated (:expand: → :render:)
- Test expectations updated ('expand' → 'render' in tuples)
Breaking change: `:expand:` must now be written as `:render:`
Related to Issue #6, Decision #7
Codecov Report❌ Patch coverage is
❌ Your project check has failed because the head coverage (66.34%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
==========================================
+ Coverage 66.24% 66.34% +0.09%
==========================================
Files 10 10
Lines 1031 1031
==========================================
+ Hits 683 684 +1
+ Misses 348 347 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Add prominent family membership badge after main badges section to establish gtext as part of the We-Birds toolkit brand. Consistent with smartswitch branding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements Phase 1 of the command syntax refactoring as defined in Issue #6.
The goal is to unify the concept of "protocols" and "modifiers" into a single "command" abstraction, where all commands use consistent
command:syntax and can be composed in pipelines.Changes
1.1 - Remove implicit
static:fallbackstatic:protocol is now mandatorystatic:syntaxBreaking change: Files using implicit
{path}must now usestatic: {path}1.2 - Rename terminology (modifier/protocol → command)
SOURCE_COMMANDS(static, cli, glob) andTRANSFORM_COMMANDS(render, tldr, translate)1.3 - Spacing (skipped - already OK)
cli: dateandcli:dateare accepted1.4 - Rename
expand:→render:_expand_content→_render_content:expand:→:render:)Breaking change:
:expand:must now be written as:render:Test Results
Breaking Changes Summary
static:removed - all file paths must now explicitly usestatic:prefixexpand:renamed torender:- update all:expand:to:render:in your .gtext filesRelated
Checklist