Skip to content

Commit

Permalink
Forbid no/abundant whitespace before array initializer
Browse files Browse the repository at this point in the history
Forbid these

    new int[]{...

    new int[]    {....
  • Loading branch information
findepi authored and martint committed Apr 10, 2024
1 parent 1922903 commit 790b632
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Airbase 155
* Checkstyle updates:
- Require exactly one space between array type and array initializer.

Airbase 154
* Fix javadoc building when `air.compiler.enable-preview` is set

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@
<property name="ignoreComments" value="true" />
</module>

<module name="RegexpSinglelineJava">
<!-- Forbid "new Type[]{", IntelliJ would reformat adding a space -->
<!-- Forbid "new Type[] {", IntelliJ would reformat removing a space -->
<property name="format" value="new\s++\w++(&lt;\?&gt;)?(\[\])++(\s{2,})?\{" />
<property name="message" value="Incorrect whitespace before array initializer" />
<property name="ignoreComments" value="true" />
</module>

<!-- javadoc -->
<module name="RequireEmptyLineBeforeBlockTagGroup" />
<module name="NonEmptyAtclauseDescription" />
Expand Down

0 comments on commit 790b632

Please sign in to comment.