LoginSignup
1
1

More than 5 years have passed since last update.

Eclipse CDT 忘備録 cpplint

Posted at

Ecripse-CDT で cpplint

  • 設定方法と使用方法を調べたので、忘れないうちに、記述しておく。

Ecripse-CDT の外部ツールに cpplint を登録

  • [外部tool実行]ボタン右の[▼]ボタンを押下 → External Tppls Configuration... を選択。
    image.png

  • ①の New ボタンを押下 → ②のName: に cpplint を入力

  • Main タブ → Location: /usr/bin/python → Arguments:/usr/bin/cpplint ${resource_loc}
    image.png

  • Common タブ → External Tools に チェック ON → Launch background の チェック OFF
    image.png

  • Apply ボタン 押下

使用時

  • project 全てを一度にチェックできない。1ファイル毎にチェックしていく。
    • チェック対象ファイルを エディタ画面で編集対象としておき、[外部tool実行]ボタン右の[▼]ボタンを押下 → cpplint を選択。

image.png

  • cpplint の 実行結果が Eclipse 画面下方の Console に出力される。
    • この行番号に マウスクリックで飛ばす方法はありそうだけども、わからず…。 CTRL+L で手入力で飛ばす。

cpplint 前の Build について

  • cpplint の実行前に Build を行う設定がデフォルトのなっている。
    • 修正時に build 不可になる やらかしを行いかねないため?
  • cpplint 前の build の実施/未実施は 選択可能。
  • [外部tool実行]ボタン右の[▼]ボタンを押下 → External Tppls Configuration... → Program [cpprint] → Build タブ image.png
  • Build before launch の チェックボタン で制御可能

CPPLINT.cfg

  • cpplint のオプションは、ソースファイルのディレクトリ または その上位の プロジェクトのルートディレクトリに CPPLINT.cfg を配置し、設定内容を書き込む。
    • autotools の プロジェクトなら src ディレクトリ がお薦め。

参考Webページ

1
1
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
1