×

Sign in with twitter.

You can follow the user and hashtags.

Share your tips on social media.

Post relative tips.

If you have relative tips, click [Add relative tips] to post.

phpcsで特定のSnifferをチェックから除外したい

@kaz_29@kaz_29 6004 viewer 60 embed viewer embed
# myruleset.xml

<?xml version="1.0"?>
<ruleset name="Custom Standard">
<description>My custom coding standard</description>

<rule ref="PSR1">
<exclude name="Generic.NamingConventions.CamelCapsFunctionName"/>
<exclude name="PSR1.Files.SideEffects"/>
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
</rule>
<rule ref="PSR2">
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
</rule>
</ruleset>

こんなxmlファイルを作成して、下記でいける。

$ phpcs --standard=myruleset.xml hoge.php

Click this to change format.

Add relative tips

Users who share this tip.

Comments