首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CheckStyle评论

CheckStyle评论
EN

Stack Overflow用户
提问于 2019-06-27 13:28:16
回答 2查看 2.5K关注 0票数 0

在思想上,我转向选项“第一列的评论”

CheckStyle抛出一个错误如何解决它

代码语言:javascript
复制
 Comment has incorrect indentation level 0, expected is 10, indentation should be the same level as line 139. [CommentsIndentation]

编辑28.06.2019

checkstyle.xml

观念偏好

If块

代码语言:javascript
复制
148:            CompletableFuture.allOf(terminateEnvironmentResponseCompletableFuture, checkInvoicePaidResponseCompletableFuture,
149:                inactiveUserResponseCompletableFuture).whenComplete((v, th) -> {
151:              if (th != null) {
152:                log.error(th.getMessage(), th);
153:              }
154:              finishDelete(userDto);
155:            });

错误:

代码语言:javascript
复制
....java:150: 'if' has incorrect indentation level 14, expected level should be 18. [Indentation]
....java:151: 'if' child has incorrect indentation level 16, expected level should be 20. [Indentation]
....java:152: 'if rcurly' has incorrect indentation level 14, expected level should be 18. [Indentation]
....java:153: 'block' child has incorrect indentation level 14, expected level should be 18. [Indentation]
....java:154: 'block rcurly' has in*correct indentation level 12, expected level should be 16. [Indentation]

注释

代码语言:javascript
复制
108:          .withIdentity("ServicesTrigger", "TriggerGroup")
109://           is fired every day at 3:00 am
110:          .withSchedule(cronSchedule("0 0 3 * * ?"))
111://          .withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(12).repeatForever())
112:          .forJob(_servicesJob)
113:          .build();
114:      _scheduler.scheduleJob(_servicesJob, serviceTrigger);

错误:

代码语言:javascript
复制
....java:110: Comment has incorrect indentation level 0, expected is 10, indentation should be the same level as line 111. [CommentsIndentation]
....java:112: Comment has incorrect indentation level 0, expected is 10, indentation should be the same level as line 113. [CommentsIndentation]
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-07-01 14:06:17

在思想上,我转向选项“第一列的评论” CheckStyle抛出一个错误如何解决它

CommentsIndentation目前不支持第一列中需要的注释。默认行为是注释必须在与周围代码相同的缩进处。

如果您想从CommentsIndentation中看到这种行为,您将需要在github上的校验样式上创建一个问题。现在,我建议禁用支票。要么从配置中删除它,要么注释掉它。

票数 3
EN

Stack Overflow用户

发布于 2021-11-08 18:53:14

您可以将注释斜杠"//“放在注释行文本的正前方。可以解决你的问题。

你的例子:

代码语言:javascript
复制
108:          .withIdentity("ServicesTrigger", "TriggerGroup")
109:          //is fired every day at 3:00 am
110:          .withSchedule(cronSchedule("0 0 3 * * ?"))
111:          //.withSchedule(SimpleScheduleBuilder. etc...
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56792141

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档