Skip to content

Trim spaces from start grammar#20

Merged
g-eoj merged 1 commit into
mainfrom
trim-start-grammar
Feb 24, 2026
Merged

Trim spaces from start grammar#20
g-eoj merged 1 commit into
mainfrom
trim-start-grammar

Conversation

@g-eoj
Copy link
Copy Markdown
Owner

@g-eoj g-eoj commented Feb 24, 2026

No description provided.

@g-eoj g-eoj marked this pull request as ready for review February 24, 2026 16:10
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 24, 2026

Greptile Summary

This PR cleans up the grammar generation by trimming trailing spaces from the start definition. The build_grammar function previously appended strings with trailing spaces throughout its construction loop, leaving an unwanted trailing space at the end of start_def. The fix applies .strip() on line 157 to remove this trailing whitespace before joining the grammar components.

Key Changes:

  • Applied .strip() to start_def in build_grammar function to remove trailing space
  • Updated test anchor strings to not include trailing spaces (consistent with cleaner output)
  • Refreshed snapshot assertions to reflect the new multi-line format

This is a clean formatting improvement with no functional changes to the grammar semantics.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is a simple formatting improvement that removes trailing whitespace from generated grammars. All tests have been updated to match the new format, and the change doesn't affect grammar semantics or functionality.
  • No files require special attention

Important Files Changed

Filename Overview
cragents/_utils.py Adds .strip() to remove trailing space from grammar start definition, improving grammar format consistency
tests/test_agent.py Removes trailing spaces from test anchor strings to align with cleaner grammar output
tests/test_grammar.py Updates snapshot assertions to reflect multi-line format and cleaner start grammar without trailing space

Last reviewed commit: d762503

@g-eoj g-eoj merged commit e888fba into main Feb 24, 2026
4 checks passed
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