Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[String] Fixed u()->snake(), b()->snake() and s()->snake() methods#57497

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:5.4fromarczinosek:fix_57464
Jun 28, 2024

Conversation

@arczinosek
Copy link
Contributor

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#57464
LicenseMIT

[String] ByteString::snake and AbstractUnitcodeString::snake methods doesn't convert all uppercase words in the right way.

For example, string "GREAT SYMFONY" is converted to "greatsymfony" instead of "great_symfony".

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.2 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@arczinosekarczinosek changed the base branch from7.2 to5.4June 22, 2024 20:20
@arczinosek
Copy link
ContributorAuthor

arczinosek commentedJun 22, 2024
edited
Loading

  1. fabbot suggests me a fix with coding standards, but it's for a different part of the code. Should I apply?
  2. Because of my mistake milestone was probably incorrectly set to 7.2 instead of 5.4, sorry

@xabbuhxabbuh modified the milestones:7.2,5.4Jun 22, 2024
@alexandre-daubois
Copy link
Member

You can ignore fabbot suggestion that are unrelated to your code.

I've got a remark about this change. This is a behavior update, which seems indeed like a bug fix. However, many people could rely on the current behavior and this change could definitely bring a lot of unexpected breakages wherever this is used. This would mean a lot of BC breaks are to be expected which is not permitted by patch and minor versions bugfixes are targeting. 🤔 Because of this, I'm not sure this can be accepted as-is. Curious to have the opinion of someone else.

arczinosek reacted with thumbs up emoji

@symfonysymfony deleted a comment fromcarsonbotJun 23, 2024
@nicolas-grekas
Copy link
Member

Can you amend+push again to trigger tests? Strange they didn't run.
On my side this is a legit bugfix.

The ByteString::snake and AbstractUnitcodeString::snake methods had a bug that caused incorrect string conversion results for all uppercase words separated by space or "_" character.Ex. "GREAT SYMFONY" was converted to "greatsymfony" instead of "great_symfony"
@arczinosek
Copy link
ContributorAuthor

Can you amend+push again to trigger tests? Strange they didn't run. On my side this is a legit bugfix.

Done

@nicolas-grekas
Copy link
Member

Thank you@arczinosek.

@nicolas-grekasnicolas-grekas merged commit6517957 intosymfony:5.4Jun 28, 2024
This was referencedJun 28, 2024
@VincentLanglet
Copy link
Contributor

VincentLanglet commentedJun 28, 2024
edited
Loading

Hi, I think this introduce a bug/important change in the way snake case is generated.

Prior to this PR,symfony is great was snaked tosymfony_is_great.
Now it'ssymfony_____is_____great.

Is it wanted@arczinosek@nicolas-grekas ?

This was referencedJun 28, 2024
nicolas-grekas added a commit that referenced this pull requestJun 29, 2024
This PR was merged into the 5.4 branch.Discussion----------[String] Normalize underscores in snake()| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#57497 (comment)| License       | MITCommits-------0e6cd07 normalize underscores in snake()
@nicolas-grekas
Copy link
Member

@VincentLanglet see#57594

VincentLanglet reacted with thumbs up emoji

@derrabus
Copy link
Member

Another regression has been reported:#57612

@xabbuh
Copy link
Member

see#57615

nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull requestJul 1, 2024
…nd s()->snake() methods (arczinosek)"This reverts commit6517957, reversingchanges made to572ce41.
fabpot added a commit that referenced this pull requestJul 1, 2024
…>snake() methods" (nicolas-grekas)This PR was squashed before being merged into the 5.4 branch.Discussion----------[String] Revert "Fixed u()->snake(), b()->snake() and s()->snake() methods"| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#57612| License       | MITThis PR reverts#57497 for BC reasons, but keeps the test cases we added in the process. Those test cases allowed to spot a real issue where the ascii and unicode implementations didn't agree on the resulting camel case for `SYMFONY IS GREAT`. Both implementations now result in `SYMFONYISGREAT` (likely introduced in#47423).Commits-------6397c38 [String] Revert "Fixed u()->snake(), b()->snake() and s()->snake() methods"
fabpot added a commit that referenced this pull requestJul 6, 2024
This PR was merged into the 5.4 branch.Discussion----------[String] test: kebab-case to snake_case| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes?| New feature?  | no| Deprecations? | no| Issues        | -| License       | MITIn Symfony 7.1.1, `kebab-case` strings casted to `snake_case` properly. The changes made in 7.1.2 broke this functionality and kept it `kebab-case`.It would be nice to have a `kebab-case` test added to the list to clearly define the expected behavior.Relates to:#57497,#57612,#57616Commits-------a6d0f3b test: kebab-case to snake_case
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@xabbuhxabbuhxabbuh approved these changes

@chalasrchalasrAwaiting requested review from chalasr

@dunglasdunglasAwaiting requested review from dunglas

@OskarStarkOskarStarkAwaiting requested review from OskarStark

@ycerutoycerutoAwaiting requested review from yceruto

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

u('Principal SIS ID')->snake() return principal_sisid, not principal_sis_id

7 participants

@arczinosek@carsonbot@alexandre-daubois@nicolas-grekas@VincentLanglet@derrabus@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp