Intellij IDEA code format

Tabs and Indents

  • Tab size 4
  • keep indents on empty lines

Spaces

Before Parenthenses

  • 'if' parentheses

  • 'for' parentheses

  • 'while' parentheses

  • 'switch' parentheses

  • 'try' parentheses

  • 'catch' parentheses

  • 'synchronized' parentheses

Around Operators

  • Assignment operators (=,+=,....)

  • Logical operators (&&, ||)

  • Equality operatores

  • Relational operators

  • Bitwise operators

  • Additive operators

  • Multiplicative operators

  • Shift operators

  • Unary operators

  • lambda arrow

Before Left Brace

  • Class left brace

  • Method left brace

  • if left brace

  • else left brace

  • for left brace

  • while left brace

  • do left bvrace

  • Switch left brace

  • try left brace

  • catch left brace

  • finally left brace

  • Synchronized left brace

  • Array initializer left brace

Before Keywords

  • else keyword

  • while keyword

  • catch keyword

  • finally keyword

Within

  • Array initializer braces

In Ternary Opertator

  • Before '?'

  • After '?'

  • Before ':'

  • After ':'

Type Arguments

  • After comma

Other

  • After comma

  • Before for semicolon

  • After for semicolon

  • Sapce before colon in foreach (待确认)

Type Paramters

  • Around Type bounds

Wrapping and Braces

keep when reformatting

  • comment at first column

  • Simple blocks in one line

  • simple methods in one line

  • simple lambda in one line

  • simple classes in one line

if() statement

  • Froce braces (always)

  • Special 'else if ' treatment

for() statement

  • Align when multiline

  • Force brace(always)

while() statement

  • Force brace (Always)

switch statment

  • Indent case branch

  • case in new line

try-with-resources

  • Align when multiline

Imports

general

  • User single class import
  • Class count to use import with '*' : 8
  • Names count to use static import with '*' 5

更新

最近发现了新大陆google 的codestyle github https://github.com/google/styleguide
[使用方式] (https://www.jianshu.com/p/a44329bf5935)

Inteiilj IDEA 团队代码格式规范的更多相关文章

  1. python代码格式规范

    目前的规范基于pep-0008 基本格式 缩进 使用4个空格进行缩进 行宽 每行代码尽量不超过80个字符 理由: 这在查看side-by-side的diff时很有帮助 方便在控制台下查看代码 太长可能 ...

  2. Java代码格式化规范实践总结

    目标说明 统一良好的代码格式规范可以有效提升开发团队之间的「协作效率」,如果不同的开发团队或者开发人员采用不同的代码格式规范,那么每次Format代码都会导致大量的变化,在Code Review及Me ...

  3. OverWatch团队文档格式规范

    V1.0 最终修改于2016/10/19 概述 软件工程中,一份优雅的文档不仅能降低团队成员之间的沟通难度,而且能给之后的开发者提供一个非常有效的引导.本团队为了规范整个项目中文档的格式,便于统一管理 ...

  4. 中小型前端团队代码规范工程化最佳实践 - ESLint

    前言 There are a thousand Hamlets in a thousand people's eyes. 一千个程序员,就有一千种代码风格.在前端开发中,有几个至今还在争论的代码风格差 ...

  5. iOS团队代码规范

    iOS团队代码规范 工程之始可能需要的工具: 1.使用CocoaPods类库管理工具.CocoaPods安装和使用教程. 2.下载安装注释插件VVDocumenter-Xcode. 一.项目结构管理 ...

  6. WEB学习笔记4-前端代码基本命名规法和格式规范

    1.HTML命名规范及格式规范 标签名和属性应该都小写,虽然HTML代码不区分大小写:属性值应该用双引号闭合. <IMG src=demo.jpg alt='test'/>(N) < ...

  7. java代码注释规范

    java代码注释规范   代码注释是架起程序设计者与程序阅读者之间的通信桥梁,最大限度的提高团队开发合作效率.也是程序代码可维护性的重要环节之一.所以我们不是为写注释而写注释.下面说一下我们在诉求网二 ...

  8. [转]java代码注释规范

    代码注释是架起程序设计者与程序阅读者之间的通信桥梁,最大限度的提高团队开发合作效率.也是程序代码可维护性的重要环节之一.所以我们不是为写注释而写注释.下面说一下我们在诉求网二期开发中使用的代码注释规范 ...

  9. C#代码开发规范

    Wrod下载           C#代码开发规范     文件状态: [√] 草稿 [  ] 正式 [  ] 修改 文件标识: 当前版本: 1.1 作    者: Empty 联系电话: 最后更新: ...

随机推荐

  1. JUC集合之 CopyOnWriteArrayList

    CopyOnWriteArrayList介绍 它相当于线程安全的ArrayList.和ArrayList一样,它是个可变数组:但是和ArrayList不同的时,它具有以下特性: 它最适合于具有以下特征 ...

  2. python值传递和指针传递

    a= 1def change_integer(a):        a=a+1        return a print change_integer(a)print a b= [1, 2, 3] ...

  3. 基于DRL和TORCS的自动驾驶仿真系统——之环境配置

    基于DRL和TORCS的自动驾驶仿真系统 --之环境配置 玩TORCS和DRL差不多有一整年了,开始的摸爬滚打都是不断碰壁过来的,近来在参与CMU的DRL10703课程学习和翻译志愿者工作,也将自己以 ...

  4. Joyoi花店橱窗(原tyvj1124)

    题目:http://www.joyoi.cn/problem/tyvj-1124 两点注意!!! 1.滚动数组的初始化: 2.字典序操作! 感到很有趣!!! #include<iostream& ...

  5. Tomcat 自动化部署

    Tomcat 自动化部署脚本 使用方法: ./autodeploy.sh test 其中autodeploy.sh 为脚本的文件名, test为war的文件名. #!/bin/sh now=`date ...

  6. Angular 4 投影

    1.创建工程 ng new demo4 2. 创建子组件 ng g component child 3.子组件html定义 <div class="wrapper"> ...

  7. Android 禁止系统进入深度休眠

    在Linux系统中,wake_lock是一直锁机制,只要有驱动占用这个锁,系统就不会进入深度休眠. 获取此锁的方法有两种: 1.在adb中通过指令获取wake_lock,系统就不会进入深度休眠 ech ...

  8. Openwrt 3g模块

    支持Huawei E367 一.编译选项的选择 都选上 都选上 Network目录下 Utiles Luci 二.USB连接3G模块时,显示如下,表示成功 三.没找到:

  9. windows下使用vscode编写运行以及调试Python

    更新于2018年10月: 首先去python官网下载python3  地址:https://www.python.org/downloads/windows/ 下载好后直接安装 记得勾选添加环境变量 ...

  10. BASIC-26_蓝桥杯_报时助手

    示例代码: #include <stdio.h> void print(int x) { switch(x) { : printf("zero ");break; : ...