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. handler之责任链模式

    https://www.cnblogs.com/java-my-life/archive/2012/05/28/2516865.html

  2. C#读取Mysql blob字段 (转帖)

    http://blog.csdn.net/config_man/article/details/6123191 开发环境:Windows XP Professional SP3.VS2008.Winf ...

  3. 回归cnBlogs

    一.最近的想法     最近几天看了好多IT和非IT朋友的技术博客和自媒体博客,本想自己搭建一个独立博客,查了好多资料,各种方法,比如:goDaddy购买域名,利用GitHub免费空间搭博客.     ...

  4. npm 发包的简易流程

     发包的简易流程: https://www.jianshu.com/p/ea64fd01679c 错误集锦: npm publish error: 403. You do not have permi ...

  5. 【python】专用下划线标识符说明

    __xxx__:系统定义名字 __xxx:类中私有变量名 说明:__xxx看做“私有的”,在模块或者类外是不可以使用.

  6. 设计模式初学者笔记:Builder模式

    [作者:byeyear    Email:byeyear@hotmail.com    首发:cnblogs    转载请注明] 在本文的开头,先森森的鄙视下自己……将Builder模式反反复复读了七 ...

  7. 【C#】string格式的日期转为DateTime类型及时间格式化处理方法

    日期格式:yyyyMMdd HH:mm:ss(注意此字符串的字母大小写很严格) yyyy:代表年份 MM: 代表月份 dd: 代表天 HH: 代表小时(24小时制) mm: 代表分钟 ss: 代表秒 ...

  8. bzoj2242 计算器

    Description 你被要求设计一个计算器完成以下三项任务: 1.给定y,z,p,计算Y^Z Mod P 的值: 2.给定y,z,p,计算满足xy≡ Z ( mod P )的最小非负整数: 3.给 ...

  9. DOM节点的增删改查

    在开始展开DOM操作前,首先需要构建一棵DOM树. <!DOCTYPE html> <html lang="en"> <head> <me ...

  10. apache 服务器在ubuntu上图片无法显示解决

    很简单的一段代码实例: <!DOCTYPE html> <html> <body> <h2>Welcome here!</h2> <i ...