You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2022/06/14 01:52:16 UTC

[servicecomb-java-chassis] branch master updated: [SCB-2567] enable checkstyle NeedBraces (#3069)

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
     new 83ebcbad6 [SCB-2567] enable checkstyle NeedBraces (#3069)
83ebcbad6 is described below

commit 83ebcbad618e5998e0ff3e73743dbc68df9e2572
Author: TingTing Wang <19...@qq.com>
AuthorDate: Tue Jun 14 09:52:11 2022 +0800

    [SCB-2567] enable checkstyle NeedBraces (#3069)
---
 ci/checkstyle/checkstyle.xml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ci/checkstyle/checkstyle.xml b/ci/checkstyle/checkstyle.xml
index 1aecaa3df..4ea168a22 100644
--- a/ci/checkstyle/checkstyle.xml
+++ b/ci/checkstyle/checkstyle.xml
@@ -44,6 +44,11 @@
       <property name="allowLineBreaks" value="true"/>
       <property name="severity" value="error"/>
     </module>
+    <!-- Checks for braces around if and else blocks -->
+    <module name="NeedBraces">
+      <property name="severity" value="error"/>
+      <property name="tokens" value="LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO"/>
+    </module>
     <module name="NoWhitespaceBefore">
       <!-- Checks that there is no whitespace before various unary operators.
            Linebreaks are allowed.