Shopify / Shopify/packwerk

[Bug Report] location column for violations through association inspector is wrongly displayed in packwerk-vscode

Open
#396 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
1.9k
Forks
121
Avg merge
2m
Merged PRs (30d)
1

Description

Description
image

The violation should start at the name of the association, not the method call. In this example, :summaries and :todos should be underlined (using packwerk-vscode, but I've validated that this problem occurs in packwerk's output). You can see that the length of the violating piece of code corresponds to the name, but the location is wrong.

I assume this was introduced with the recent parser change, in which case it could point to a bug in Prism's parser translator.

To Reproduce
Analyze a file with a violating association.

Expected Behaviour
The violation is attributed to the name of the association, which is an implicit constant reference

Version Information

  • Packwerk: 3.2.0
  • Ruby 3.2.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the violation from a file containing an association inspector, then inspect the parser translator, especially the Prism integration mentioned in the report. Done means the reported location starts at the association name, such as :summaries or :todos, while preserving the violating span length.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.