1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CodeClimateでチェックするルールを変更する

Posted at

CodeClimateを使っていて特定のチェックを無視したい場合は.codeclimate.ymlでカスタマイズできる。
今回はPHPの場合です。

phpmdで短い変数名だとCodeClimateのissuesに上がってきますが、
これをチェックしたくない場合は.codeclimate.ymlを作成して以下のように記述します。

codeclimate.yml
engines:
  phpmd:
    enabled: true
    checks:
      Naming/ShortVariable:
        enabled: false
ratings:
  paths:
  - "**.php"

これでNaming/ShortVariableはチェックされなくなります。

他にもルールを変更したい場合はCodeClimateのissuesの一覧画面で右上に目みたいなアイコンがあるので、
そこの「Disable Check」をクリックします。

スクリーンショット 2017-03-24 16.20.17.png

そうすると.codeclimate.ymlの記述例が表示されます。

スクリーンショット 2017-03-24 16.20.21.png

あとはその内容を.codeclimate.ymlに記述すればOKです。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?