LoginSignup
3
1

More than 3 years have passed since last update.

google-java-formatの適用

Posted at

はじめに

JavaCodeスタイルはたくさんありますが、
例えば:
Javaコーディング規約:https://future-architect.github.io/coding-standards/documents/forJava/Java%E3%82%B3%E3%83%BC%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0%E8%A6%8F%E7%B4%84.html

Google Java Style:https://google.github.io/styleguide/javaguide.html

Codeのフォーマッタがあると便利だと思われます。

Google Java Styleに合わせたい

開発者はstyleの理解をしましたが、フォーマッタも自動化しないと漏れの可能性があります。
google-java-formatを適用すれば便利です。

google-java-formatとは

google-java-format is a program that reformats Java source code to comply with Google Java Style.

インストール方法

IntelliJ, Android Studio, and other JetBrains IDEs などPluginをインストールできます。

EclipseはJARファイルをダウンロードし、Eclipseのpluginsフォルダに配置した後、Eclipseを再起動
image.png

設定後、JAVAファイルを開いて、Ctrl + Shift + F でフォーマットできます。

以上

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