-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix alignment of property assignments in the __construct() function
#12995
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 alignment of property assignments in the __construct() function
#12995
Conversation
… of the block parser.
| $this->blockName = $name; | ||
| $this->attrs = $attrs; | ||
| $this->innerBlocks = $innerBlocks; | ||
| $this->innerHTML = $innerHTML; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why this wasn't caught by the phpcs config in Gutenberg? should we update it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Good question. Let me dig in a bit. I am not familiar with the plugin's ruleset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, now that I look, there are a number of PHPCS issues in this file. Wonder if it's running against it at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is <exclude-pattern>./lib/parser.php</exclude-pattern> in the PHPCS file, but I don't think this is excluding this specific file.
I think that the file is just not being processed from lack of inclusion rather than exclusion. Replacing all the <file></file> tags and replacing them with just <file>.</file> (all files) correctly formats this file, but also a handful of others (but all other files are e2e or phpunit test related).
If possible, I'd like to merge this change, and explore modifying the ruleset in a separate PR.
earnjam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an alignment fix 👍
|
Also would be good if we create a corresponding issue in the |
|
So it looks like we aren't running PHPCS against any packages except from Changing that to run against all packages kicks errors in the |
|
Can we add the package the phpunit config and fix the issues? Is it too much work? |
It's already tracked in #13002 which is assigned to 5.0.3 Milestone :) |
|
I believe that this did not make it in time for the package releases for 5.0.2, so moving this to the next milestone. If that is not true, feel free to move it back. |
|
This will be 4.8 actually which is the current (closed scope) milestone. |
When
grunt buildis run in WordPress core, the parser is copied to the appropriate place in the core code base. But, because these lines are not aligned correctly, thewp-includes/class-wp-block-parser.phpfile always shows changes.This fix will prevent that from happening.
See the Slack discussion for more information.