Intellij Idea team's necessary configuration for collaborative development

You can use the google style method, or the unified code Style/file and code template file of the respective company

1. Install google-java-format
preferences -> plugins -> Browse repositories...
search for google-java-format
Write picture description here

Enable google-java-format
Write picture description here

2. Install save actions
preferences -> plugins -> Browse repositories…
Search for save actions to
Write picture description here
enable
automatic formatting when save actions are saved, and 
delete useless import statements

Three, automatically optimize the guide package options

Optimize imports on the fly: automatically remove some unused packages
Add unambiguous imports on the fly: automatically help us optimize imported packages unambiguous: explicitly

Fourth, check the line separator/indent size

Line separators need to be unified, and windows must not be used
Write picture description here

The indentation size needs to be uniform
Write picture description here

  •  

Guess you like

Origin blog.csdn.net/fei33423/article/details/111594621
Recommended