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

Make sure all internal lists do not rely on keywords order #117

Merged
merged 2 commits into from
May 24, 2024

Conversation

mvorisek
Copy link
Contributor

as requested in #107 (review)

Into 1.4.x as this is needed for #106 bugfix where the lists are massively updated based on exact SQL specs.

We keep the lists alpha sorted for easier maintenance but resort them by length in the tokenizer for longest match.

The lists should not be defined sorted by length, as with comming bugfix PR, the sorting by length will no longer be needed, as there is nothing like "multi-word reserved keyword".

@mvorisek mvorisek marked this pull request as ready for review May 22, 2024 21:57
@mvorisek mvorisek force-pushed the sort_kws_lists branch 3 times, most recently from 962aa45 to 951d50f Compare May 22, 2024 22:22
goetas
goetas previously approved these changes May 23, 2024
Copy link
Member

@goetas goetas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of it but is ok from my pow

Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 2 mixed concerns in this PR, one of them wasn't in the original PR. There should at least be 2 commits, each with meaningful commit messages that don't just tell us what you did, but why you did it. If you want things to go fast, I suggest you create several PRs, one for each commit, with good commit messages and explanations, rather than pinging us in the middle of the night, only one hour after creating your PR. And by "suggest", I of course mean "require".

@mvorisek mvorisek changed the title Keep internal lists of keywords sorted Sort internal lists of keywords for easier maintenance May 23, 2024
return $res;
}

public function testInternalKeywordListsAreSortedForEasierMaintenance(): void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think that this should be a code style check rather than an unit test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you know how, then great and definitely tell me, if not, let's move with this PR. In #106 I need to add many keywords and I want to make sure the git diff is minimal for now and long term.

@mvorisek mvorisek requested review from goetas and greg0ire May 23, 2024 08:18
@mvorisek mvorisek changed the title Sort internal lists of keywords for easier maintenance Make sure all internal lists do not rely on keywords order May 23, 2024
@mvorisek
Copy link
Contributor Author

@greg0ire I have reworked the commits to be more readable. I hope the commits answer all questions. Please merge it to 1.4.x as part of #106 bugfix.

@greg0ire greg0ire merged commit f9f2468 into doctrine:1.4.x May 24, 2024
10 checks passed
@greg0ire greg0ire added this to the 1.4.1 milestone May 24, 2024
@mvorisek mvorisek deleted the sort_kws_lists branch May 24, 2024 07:40
@greg0ire greg0ire added the bug Something isn't working label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants