google / google/styleguide

How the 4.4 Column Limit: 100 rule works for JSNI Method Reference?

Open
#808 0 comments 0 reactions 0 assignees View on GitHub
lang:java
Dominant language
HTML
Stars
39.6k
Forks
12.9k
Avg merge
42m
Merged PRs (30d)
15

Description

Hey, I'm a contributor at Checkstyle. I was working on this [issue](https://github.com/checkstyle/checkstyle/issues/14487) to add support for detecting JSNI method for rule [4.4 Column Limit: 100](https://google.github.io/styleguide/javaguide.html#s4.4-column-limit). I made a PR regarding this issue, but there I got stuck on how we should approach this issue. Initially I discussed with the maintainers and we came up with the idea of ignoring the column limit for whole JSNI method declaration for this rule. You can take a look at this file for better understanding how we are ignoring JSNI methods for this rule: https://github.com/checkstyle/checkstyle/blob/40934dddede18b5f004f678f6704a84e32847cb2/src/it/resources/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/InputLineLengthJsniMethods.java

> Lines where obeying the column limit is not possible (for example, a long URL in Javadoc, or a long JSNI method reference).

But as you can see google style guide says we only need to ignore the long JSNI method references. One of the maintainer suggested that the JSNI method reference is wrap-able so why there is a need to ignore JSNI reference for this rule when we can wrap it to make it under the column limit?

Here is the conversation [link](https://github.com/checkstyle/checkstyle/pull/14501#discussion_r1522480694) for your reference. Can anyone explain us how the Column Limit rule should work for JSNI Methods? Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.