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. Microsoft Dynamics CRM 2011 面向Internet部署 (IFD) CRM 登录出现会话超时的解决办法

    一.IFD 登录的时候,过了一段时间,会马上出现“您的会话已过期”,怎么解决这个问题呢,可以通过改变这个时间.具体图如二 Link to Dynamics CRM Wiki Home Page 二.S ...

  2. oracle schema 白话文详解

    概述: (一)什么Oracle叫用户(user): A user is a name defined in the database that can connect to and access ob ...

  3. 在C#客户端用HTTP上传文件到Java服务器

    在C#客户端用HTTP上传文件到Java服务器  来源:http://www.cnblogs.com/AndyDai/p/5135294.html 最近在做C / S 开发,需要在C#客户端上传文件到 ...

  4. golang之配置环境

    从https://golang.org/dl/下载相关包,直接解压 目录大概这样 golang ├── go └── mods 配置环境变量 vim ~/.profile(debian需要勾选shel ...

  5. android设备唯一码的获取,cpu号,mac地址

    抄自http://blog.csdn.net/hpccn/article/details/7872141 开发Android应用中,我们常常需要设备的唯一码来确定客户端. Android 中的几中方法 ...

  6. ESXI5.5设置主机的时间自动同步服务 NTP

    背景:现在公司的很多线上服务也都通过虚拟化来实现,最近遇到一个小问题,虚拟机上的时间不准确.原来是虚拟机会主动同步宿主机时间,一般虚拟机中都安装vmware tool工具,这个工具会自动和宿主机进行时 ...

  7. Python 常用PEP8规范

    目录 目录 代码布局 缩进 最大行宽 空行 模块导入 字符串 表达式和语句中的空格 注释 命名规则 编程建议 代码布局 缩进 每级缩进用4个空格. 括号中使用垂直隐式缩进或使用悬挂缩进. EXAMPL ...

  8. Spark分析之DAGScheduler

    DAGScheduler概述:是一个面向Stage层面的调度器: 主要入参有: dagScheduler.runJob(rdd, cleanedFunc, partitions, callSite, ...

  9. [Dart] Flutter 上传文件

    /** * 请求响应数据 */ class MsgResponse { int code; // 状态代码,0 表示没有错误 Object data; // 数据内容,一般为字符串 String er ...

  10. c++官方文档-动态内存

    #include<iostream> #include <new> using namespace std; int main() { /** * 动态内存 * url: ht ...