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

Parse "NOW()" like any other function #102

Merged
merged 1 commit into from
May 13, 2024

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented May 11, 2024

now() should not be parsed as one token, especially as it can be now( ) or now(6).

It should be parsed/formatted like any other (3 letter) function like xyz().

@mvorisek mvorisek marked this pull request as draft May 11, 2024 18:40
@mvorisek mvorisek marked this pull request as ready for review May 11, 2024 19:13
@mvorisek mvorisek changed the title "NOW()" is like any other function like "XYZ()" Parse "NOW()" like any other function May 11, 2024
@mvorisek mvorisek changed the base branch from 1.3.x to 1.4.x May 13, 2024 09:06
@mvorisek
Copy link
Contributor Author

@derrabus can I please have your review here?

@derrabus
Copy link
Member

Do we know why NOW() gets the special treatment currently that you're attempting to revert?

@mvorisek
Copy link
Contributor Author

Based on git history this was introduced in jdorn/sql-formatter@e1aa999 and the PR title refers to jdorn/sql-formatter#47. I guess this was added for MySQL to format NOW() more like a value (single token), but as discussed above, this is not consistent with NOW( ) or NOW(6), or different function like COW(). So with this said, I am not aware of any specific purpose/past discussion outside this so it seems as a pure inconsistency for me.

@derrabus derrabus added the bug Something isn't working label May 13, 2024
@derrabus derrabus added this to the 1.4.1 milestone May 13, 2024
Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

@derrabus
Copy link
Member

Can you please rebase? Our CI has changed significantly in 1.4.

@mvorisek
Copy link
Contributor Author

Rebased but it seems you have to approve the CI again. Can you approve it for me for all (future) pushes to this repo/org?

@derrabus
Copy link
Member

Can you approve it for me for all (future) pushes to this repo/org?

No. You need to have contributed successfully to this repo at least once. Then, GitHub won't ask for workflow approvals anymore.

@derrabus derrabus merged commit f668301 into doctrine:1.4.x May 13, 2024
10 checks passed
@derrabus
Copy link
Member

… which should be the case now. Try to rebase your other PRs and they should trigger the CI instantly.

@mvorisek
Copy link
Contributor Author

Thank you!

@mvorisek mvorisek deleted the no_now_par_kw branch May 13, 2024 10:16
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.

2 participants