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 committed Jan 10, 2024
1 parent c53dfe2 commit b48f6d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Airbase 149
* Remove bval dependency
* Checkstyle updates:
- Require exactly one space between array type and array initializer.
* Plugin updates:
- git-commit-id-maven-plugin 7.0.0 (from 6.0.0)
- spotbugs-maven-plugins 4.8.1.0 (from 4.7.3.6)
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*+\{" />
<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 b48f6d0

Please sign in to comment.