forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#10924: Update TrailingCommentCheck to use code points
- Loading branch information
Showing
3 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...com/puppycrawl/tools/checkstyle/checks/trailingcomment/InputTrailingCommentWithEmoji.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
TrailingComment | ||
format = (default)^[\s});]*$ | ||
legalComment = ^ this is ok | ||
*/ | ||
|
||
package com.puppycrawl.tools.checkstyle.checks.trailingcomment; | ||
|
||
public class InputTrailingCommentWithEmoji { | ||
// violation below | ||
String a = "🧐🥳😠😨"; /*string with emoji */ | ||
// violation below | ||
String b = "👌🏻🤞🏻😂😂🎄"; // another string | ||
|
||
/* yet another */String c = "😂😂🎄👍"; /* this is ok */ | ||
String d = "🧐🥳"; // this is ok | ||
/* | ||
* 🎄a🎄b🎄c🎄 // violation below | ||
* 🎄 👌🏻 🤘🏻 🎄*/ void test1() { /* some | ||
🎄 adsad 🎄 /*comments */ | ||
} | ||
// violation below | ||
/*😂 😂*/ // 🤛🏻🤛🏻 | ||
|
||
/* 🎃 ☠️ */ // 👿 asd😱 // violation | ||
/* 😱 🎄 */ /*🎄 🥶 */ // violation | ||
|
||
/** // comment | ||
* 🤛🏻q🥳w👆🏻e😠r👇🏻t😨y | ||
*/ | ||
/* 👆🏻 👇🏻 */ void test2() {} // violation | ||
} |