Skip to content

Commit 3ceb589

Browse files
eugenepehdamithc
authored andcommitted
[nus-cs2103-AY2122S1#319] Checkstyle: add ArrayTypeStyle rule (#363)
We allow array type declarations in both Java and C styles, e.g. Java style: public static void main(String[] args) C style: public static void main(String args[]) However, Java style is preferred and we should only use this style in our project. Let's add ArrayTypeStyle rule to ensure that only the Java style of array type declarations is used.
1 parent 3291675 commit 3ceb589

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

config/checkstyle/checkstyle.xml

+6
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@
155155
LENGTH and CODING CHECKS
156156
-->
157157

158+
<!-- Checks that array type declarations follow Java Style
159+
Java style: public static void main(String[] args) // Allowed
160+
C style: public static void main(String args[]) // Not allowed
161+
-->
162+
<module name="ArrayTypeStyle"/>
163+
158164
<module name="LineLength">
159165
<!-- Checks if a line is too long. -->
160166
<property name="max" value="120"/>

0 commit comments

Comments
 (0)