LoginSignup
5
5

More than 5 years have passed since last update.

EmbulkのJavaコードで使われているコーディングスタイルAirliftってどんなスタイル?

Last updated at Posted at 2016-01-12

Embulkのソースコードスタイルチェック方法 (Java編) で自分の書いたプラグインのスタイルをチェックした。

修正した結果を踏まえて、指摘を受けた点についてメモをした。
詳しくは、こちらを参照

その他色々あると思うけど、そのうち追加する予定。

空白

ifやwhile

空白を開け、{の前も空白を開ける

ダメ

if(x > 0){

OK

if (x > 0) {

if分などの()の前後は、空白を入れない。

ダメ

if ( x > 0 ) {

OK

if (x > 0) {

elseやcatch, finally

独立した行にする。(※、つまり}を独立した行にしろということ)

ダメ

} else if (x < 0) {

OK

}
else if (x < 0) {

カンマの後は、スペースを入れる

ダメ

foo(boolean a,int x,int y,int z)

OK

foo(boolean a, int x, int y, int z)

複数行の改行を入れない

ダメ

package com.intellij.samples;


import com.intellij.idea.Main;

OK

package com.intellij.samples;

import com.intellij.idea.Main;
5
5
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
5
5