[Bug Report] Syntax error when rendering two partials
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.9k
- Forks
- 121
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
Description
Getting the error Syntax error: unexpected token tSTRING when rendering two partials one after another in a view.
To Reproduce
Reference two different partials one after another, eg:
<%= render "gsd/projects/states/dates", state: %>
<%= render "gsd/projects/states/state_dates", state: %>
Expected Behaviour
It should be a valid statement.
Screenshots
Take a look at this PR and the pipeline errors
Version Information
- Packwerk: [e.g. v2.2.2]
- Ruby [e.g. v3.1.2p20]
Additional Context
How have you tried to solve the issue? The way to bypass the error was to use quotes for the first render
<%= render("gsd/projects/states/dates", state:) %>
<%= render "gsd/projects/states/state_dates", state: %>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two consecutive partial renders shown in the issue and inspect the referenced PR and pipeline errors. Trace how Packwerk handles this Ruby syntax and identify the relevant parsing or rendering entry point. Done means both render statements are accepted without the unexpected-token error, including the example using keyword arguments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100