diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java index fa64460c463..39b477e4287 100644 --- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java +++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java @@ -20,6 +20,7 @@ package com.google.checkstyle.test.chapter4formatting.rule44columnlimit; import org.junit.jupiter.api.Test; +import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import com.puppycrawl.tools.checkstyle.api.Configuration; @@ -46,4 +47,15 @@ public void testLineLength() throws Exception { verify(checkConfig, filePath, expected, warnList); } + @Test + public void testLineLengthJsniMethods() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("LineLength"); + final String filePath = getPath("InputLineLengthJsniMethods.java"); + + final Integer[] warnList = getLinesWithWarn(filePath); + verify(checkConfig, filePath, expected, warnList); + } + } diff --git a/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/InputLineLengthJsniMethods.java b/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/InputLineLengthJsniMethods.java new file mode 100644 index 00000000000..08795d471ce --- /dev/null +++ b/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/InputLineLengthJsniMethods.java @@ -0,0 +1,8 @@ +package com.google.checkstyle.test.chapter4formatting.rule44columnlimit; + +public class InputLineLengthJsniMethods { + public static native void alertMessage(String msg, int a, int b, int c, int d, int e, int f, int g, int h) /*-{ + $wnd.alert(msg); + console.log('a really long message here blah blah blah bruh bruh bruhhhhhhhhhhhhhhhhhhhhhhhhhhhh'); + }-*/; +} diff --git a/src/main/resources/google_checks.xml b/src/main/resources/google_checks.xml index bc47e7e7767..b7d0342bf57 100644 --- a/src/main/resources/google_checks.xml +++ b/src/main/resources/google_checks.xml @@ -42,6 +42,14 @@ + + + + + + + +