10
4

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.

ALEを使ったコードチェック

Last updated at Posted at 2018-02-27

目的

Vim上でコーディングルールのチェックをする。
今回はALEを使ってPSR-1,2に準拠しているかのチェックをおこないます。

環境

Custom Version 8.0.1420 (KaoriYa 20171221)
PHP 7.0.17

Custom Version 8.0.1633 (KaoriYa 20180324)
PHP 7.2.13
でも問題なく動いてます(2019.03.12追記)

ALE(Asynchronous Lint Engine)

Install

ALEをインストールします。NeoBundleを使ってます。

.vimrc
NeoBundle 'w0rp/ale'

:NeoBundleInstallを実行

Settings

.vimrc

" phpcsとsyntaxチェックのみ使用する
let g:ale_linters = {
      \ 'php': ['phpcs', 'php']
      \}

" PSR-1,2のチェックをおこなう
let g:ale_php_phpcs_standard = 'PSR1,PSR2'

これだけで完了かんたーん!

10
4
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
10
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?