Glavin001/atom-beautify
GitHub で見るIncorrect PHP indentation using Atom Beautify with PHP_CodeSniffer
Open
#2,361 opened on 2019年7月2日
help wantedquestionwaiting-for-user-information
説明
Description
Practically it seems that Atom Beautify fails to “see” my custom ruleset for PHP_CodeSniffer. When I launch it then I don’t get the same result I would get if I ran the command phpcbf --standard=phpcs.xml.dist 404.php.
Steps to Reproduce
- Add code to Atom editor
- Run command
Atom Beautify: Beautify Editor - This beautified code does not look right!
Debug
Here is a link to the debug.md Gist: https://gist.github.com/vizzale/acf39b8ceb659c575d8d8559cd6136a4
Checklist
I have:
- Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
- Reloaded (or restarted) Atom to ensure it is not a caching issue
- Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues so I know this is not a duplicate issue
- Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
- Generated debugging information by executing
Atom Beautify: Help Debug Editorcommand in Atom and added link fordebug.mdGist to this issue
Extra
Here instead you find my configuration file phpcs.xml.dist:
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="WordPress Custom">
<description>PHP_CodeSniffer custom ruleset: indentation with spaces</description>
<arg name="tab-width" value="2"/>
<rule ref="WordPress">
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent"/>
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2"/>
<property name="exact" value="true"/>
<property name="tabIndent" value="false"/>
<property name="ignoreIndentationTokens" type="array">
<element value="T_HEREDOC"/>
<element value="T_NOWDOC"/>
</property>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<rule ref="PSR2.ControlStructures.SwitchDeclaration">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
</ruleset>