# 代码风格设定

代码风格设定可能是最为基础的一个工作，当新融入一个团体，配置好环境之后必须要做的就是配置代码风格和团队保持一致。

如果熟悉的话应该都会知道 [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html)

Google 提供了 IntelliJ 中的风格配置

* <https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml>

导入该样式即可。

不同团队可能对缩进和 import 语句顺序有些许调整，那也比较简单，在

```
File -> Settings -> Editor -> Code Style -> Java
```

中进行设置即可。

![codestyle settings](/files/-M5dlp3_6lLxcJ1hRB5W)

如果要调整 import 语句的顺序，在下方 Import Layout 中可以自定义导入的顺序。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://einverne.gitbook.io/intellij-idea-tutorial/codestype-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
