-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rules from phpcs.xml dosen't seem to be applied #1
Comments
Ah, good catch - I appreciate the detailed description. I changed the tool to output the command-line arguments passed to the formatter, and confirmed that our custom rules in phpcs.xml are being loaded with the phpcsf -s -q --extensions=php
--parallel=5
--runtime-set ignore_errors_on_exit 1
--runtime-set ignore_warnings_on_exit 1
--runtime-set installed_paths ~/php-beautify/wpcs
--standard=~/php-beautify/phpcs.xml
...files For some reason the rules for indentation and short array syntax were still not being applied. While trying to solve it I updated the formatter, which changed ownership since this tool was created. And also updated the WordPress code standard rules (4de08a3). Then I searched around in the defined rules in The solution was to disable this rule: <exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/> There's no opposite rule to always use short syntax and convert For the indentation, I adjusted a few things (9783fb3) but the key change was to add: <property name="exact" value="true"/> That fixes indentation as expected. The When I created it I was inspired by the Go language's standard formatter, which I've heard a lot of people enjoy because it removes the need to decide or discuss details of code syntax. Everyone just uses the formatter with the same rules, and the code is consistent across all projects. I published version 1.1.0 of the NPM package |
I was trying to run the
roll format
command of the roller (from this repository), which will then run phpBeautify if installedWhile the PHP files are being formatted, it seems that they do not use our code standard set inside phpcs.xml
For example, arrays that uses the short syntax
[]
has been replaced byarray()
. If I understood correctly, it shouldn't be the case as we exclude this rule here)The indentation is also not set to 2 space, which I think should be the case according to the rules we have here
I'm not sure what the issue is, but I tried to add
-e
to the command here to see what is being load, and it seems that we don't have any code standard from inside the wpcs folder:(I saw the comment here, so maybe it's related and it's a known issue but I thought I will create an issue in case it's not the case)
The text was updated successfully, but these errors were encountered: