codecamp

Spring Cloud Kubernetes Intellij IDEA

为了设置Intellij,您应该导入我们的编码约定,检查配置文件并设置checkstyle插件。Spring Cloud Build 项目中可以找到以下文件

spring-cloud-build-tools /。 

└── src
    ├── checkstyle
    │   └── checkstyle-suppressions.xml 
    └── main
        └── resources
            ├── checkstyle-header.txt 
            ├── checkstyle.xml 
            └── intellij
                ├── Intellij_Project_Defaults.xml 
                └── Intellij_Spring_Boot_Java_Conventions.xml 
  1. 默认抑制规则
  2. 文件头设置
  3. 默认Checkstyle规则
  4. 适用于大多数Checkstyle规则的Intellij项目默认值
  5. 适用于大多数Checkstyle规则的Intellij的项目样式约定

图150.1 代码风格

代码风格

转到FileSettingsEditorCode style单击Scheme部分旁边的图标。 在那里,单击Import Scheme值,然后选择Intellij IDEA code style XML选项。导入spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml文件。

图150.2 检验概况

代码风格

转到FileSettingsEditorInspections单击Profile部分旁边的图标。 在此处单击Import Profile,然后导入spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml文件。

Checkstyle。 要使Intellij与Checkstyle一起使用,您必须安装Checkstyle插件。建议还安装Assertions2Assertj以自动转换JUnit断言

Checkstyle

转到FileSettingsOther settingsCheckstyleConfiguration file部分中单击+图标。 在这里,您必须定义应从何处选择checkstyle规则。在上图中,我们从克隆的Spring Cloud构建库中选择了规则。但是,您可以指向Spring Cloud构建的GitHub存储库(例如,对于checkstyle.xmlhttps://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml)。 我们需要提供以下变量:

请记住将Scan Scope设置为All sources,因为我们将checkstyle规则应用于生产和测试源。
Spring Cloud Kubernetes Checkstyle配置
Spring Cloud GCP引言
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

三、Spring Cloud Netflix

SpringCloud Hystrix超时和Ribbon客户

SpringCloud 重试失败的请求

五、Spring Cloud Stream

六、SpringCloud Binder实现

SpringCloud 重试RabbitMQ Binder

SpringCloud Dead-Letter队列处理

八、Spring Cloud Sleuth

SpringCloud 当前Span

十二、Spring Cloud for Cloud Foundry

十三、Spring Cloud Contract

Spring Cloud Contract验证程序设置

SrpingCloud Gradle项目

十五、Spring Cloud网关

Spring Cloud 配置路由谓词工厂和网关过滤工厂

Spring Cloud TLS / SSL

Spring Cloud网关配置

SpringCloud 故障排除

十八、Spring Cloud GCP

Spring Cloud GCP Spring资源

Spring Cloud Spring JDBC

Spring Cloud Redis的Cloud Memorystore

Spring Cloud 云身份识别代理(IAP)身份验证

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }