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. gdb 调试(设置变量)(六)

    一旦使用GDB挂上被调试程序,当程序运行起来后,你可以根据自己的调试思路来动态地在GDB中更改当前被调试程序的运行线路或是其变量的值,这个强大的功能能够让你更好的调试你的程序,比如,你可以在程序的一次 ...

  2. 【Spring-AOP-学习笔记-5】@AfterReturning增强处理简单示例

    项目结构 业务代码 @Component("hello") public class HelloImpl implements Hello {     // 定义一个简单方法,模拟 ...

  3. [转]下拉按钮 C#_Winform 自定义控件

    [https://workspaces.codeproject.com/elia-sarti/splitbutton-an-xp-style-dropdown-split-button] using ...

  4. RESTful Java client with Apache HttpClient / URL /Jersey client

    JSON example with Jersey + Jackson Jersey client examples RESTful Java client with RESTEasy client f ...

  5. 什么是DSCP,如何使用DSCP标记搭配ROS策略

    一.什么是DSCP DSCP:差分服务代码点(Differentiated Services Code Point),IETF于1998年12月发布了Diff-Serv(Differentiated ...

  6. mysql导入导出数据中文乱码解决方法小结(1、navicat导入问题已解决,创建连接后修改连接属性,选择高级->将使用Mysql字符集复选框去掉,下拉框选择GBK->导入sql文件OK;2、phpmyadmin显示乱码的问题也解决,两步:1.将sql文件以utf8的字符集编码另存,2.将文件中sql语句中的字段字符集编码改成utf8,导入OK)

    当向 MySQL 数据库插入一条带有中文的数据形如 insert into employee values(null,'张三','female','1995-10-08','2015-11-12',' ...

  7. mysql互为主从

    摘自:http://flash520.blog.163.com/blog/static/3441447520101029114016823/ A B 为两台MySQL服务器,均开启二进制日志,数据库版 ...

  8. 如何干净的清除Slave同步信息

    MySQL> show master status; +------------------+-----------+--------------+------------------+---- ...

  9. 在docker中运行jenkins实现代码自动发布到测试服务器

    在docker中运行jenkins 用的镜像是apline版:lts-alpine,并设置正确的时区. docker run --name jenkins_master -d \ -p 8081:80 ...

  10. 探究CSS中border-top属性的使用

    上一节我们介绍了CSS top属性的用法,那么这节关于CSS border-top属性用法学习起来就会轻松一些,border-top 简写属性把上边框的所有属性设置到一个声明中. 本文向大家描述一下C ...