0
0

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 1 year has passed since last update.

【Rufo】commit時にRufoを実行する【Lefthook】

Posted at

gemのインストール

以下のコマンドを実行してLefthookをインストールします。

ターミナル
$ gem install lefthook

Lefthookの設定

Lefthookの設定をします。
lefthook.ymlを作成し、以下のように記述します。

lefthook.yml
pre-commit:
  parallel: true
  commands:
    rubocop:
      files: git diff --name-only --staged
      glob: "*.rb"
      run: rufo {files}

動作確認

以下のコマンドを実行し、正常に動作するか確認します。

ターミナル
$ lefthook install && lefthook run pre-commit
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?