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

Fix Prefer short array syntax #36

Closed
renatonascalves opened this issue Sep 15, 2023 · 1 comment · Fixed by #37
Closed

Fix Prefer short array syntax #36

renatonascalves opened this issue Sep 15, 2023 · 1 comment · Fixed by #37
Labels
enhancement New feature or request

Comments

@renatonascalves
Copy link
Contributor

renatonascalves commented Sep 15, 2023

Description

We are setting this here but it looks like it is not enough in version 2.0.

<!-- We prefer short array syntax. -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />

This rule alone doesn't work. Or

<rule ref="Universal.Arrays.DisallowShortArraySyntax" />

or together
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />

I was able to fix like that:

<rule ref="WordPress">
    <exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
    <exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
</rule>

Related: WordPress/WordPress-Coding-Standards#1968

Goal: Confirm what changed in WordPress and fix it here.

Use Case

Project using https://github.com/alleyinteractive/alley-coding-standards/releases/tag/v2.0.0

@renatonascalves renatonascalves added the enhancement New feature or request label Sep 15, 2023
@GaryJones
Copy link
Contributor

WordPress/WordPress-Coding-Standards#1920 is the key change for WordPressCS 3.0.

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

Successfully merging a pull request may close this issue.

2 participants