Skip to content
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

Prevent non keywords from accidentally matching on type formatting #2364

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

vinistock
Copy link
Member

Motivation

Closes #2301

Our regexes for matching when to add the end token were a little too permissive. We were accidentally matching something like class: "bg-white" as a class keyword.

Implementation

The reality is that there are only two possibilities for all of the keywords we provide on type formatting for: either there needs to be a space right after the keyword or they need to be at the end of the line.

Automated Tests

Added a test to ensure we don't regress.

@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Jul 25, 2024
@vinistock vinistock self-assigned this Jul 25, 2024
@vinistock vinistock requested a review from a team as a code owner July 25, 2024 15:53
@vinistock vinistock requested review from andyw8 and st0012 July 25, 2024 15:53
@vinistock vinistock force-pushed the vs-prevent-keyword-on-type-formatting-mismatch branch from d420cc7 to 898e0df Compare July 25, 2024 17:45
@vinistock vinistock merged commit a5e1775 into main Jul 25, 2024
36 checks passed
@vinistock vinistock deleted the vs-prevent-keyword-on-type-formatting-mismatch branch July 25, 2024 18:28
@andyw8
Copy link
Contributor

andyw8 commented Jul 25, 2024

@vinistock does this also solve #2302 ?

@vinistock
Copy link
Member Author

No, that issue is related to the grammar rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
2 participants