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

Add rule to enforce mixing variable cases in AcquiaDrupalStrict #19

Open
balsama opened this issue Jan 14, 2021 · 2 comments
Open

Add rule to enforce mixing variable cases in AcquiaDrupalStrict #19

balsama opened this issue Jan 14, 2021 · 2 comments

Comments

@balsama
Copy link

balsama commented Jan 14, 2021

There doesn't seem to be any enforcement of mixing snake_case for variable names with lowerCamelCase. (For example, the following variable passed PHPCS: $commit_messageFailedPatches)

Can we add something to enforce one or the other (no mixing)?

Side note:
I was surprised that Drupal coding standards don't dictate one or the other:

Variables should be named using lowercase, and words should be separated either with uppercase characters (example: $lowerCamelCase) or with an underscore (example: $snake_case). Be consistent; do not mix camelCase and snake_case variable naming inside a file.

🤷‍♀️

@TravisCarden
Copy link
Contributor

Thanks, @balsama. I'm surprised to find that the Drupal coding standards don't dictate one or the other, too! They used to--and Coder used to enforce them. The best thing I could find about it on d.o is this: Allow camelCase for variable naming conventions [#2303963]. But that's a very old issue. In any case, this does seem like it should be solved in Coder module since the official standards do seem to dictate "one or the other". Would you care to create an issue there?

@danepowell
Copy link
Collaborator

I took the liberty of opening an upstream issue: https://www.drupal.org/project/coder/issues/3244409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants