Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #14487: add support to ignore JSNI methods for LineLength check in google config #14501
Issue #14487: add support to ignore JSNI methods for LineLength check in google config #14501
Changes from all commits
40934dd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nrmancuso @romani Why are we ignoring the entire JSNI method?
https://google.github.io/styleguide/javaguide.html#s4.4-column-limit
Google seems pretty clear it should only be the method reference, in the issue's case seems to be the method declaration which I am not sure it is a reference, and not the entire method.
The
console.log
violation in the issue seems valid to me. I am starting to think the other violation is valid.https://checkstyle.org/google_style.html#a4.4
We cannot detect JSNI references without parsing support IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are to ignore JSNI completely because it is not supported by us, then https://checkstyle.org/google_style.html#a4.4 needs to be updated to say that and shouldn't be removed or turned green. The example in the issue doesn't seem to be a valid reason to ignore JSNI. It should be centered around we cannot identify JSNI method references which is what Google says we must be able to identify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have examples of method reference?
What is this? And how it looks like?
I found https://groups.google.com/g/Google-Web-Toolkit/c/8PXM54IwtDE/m/9naSp1CTYdcJ , so looks like
@com.ecopy.gwt.client.Utils::messageBox(Ljava/lang/String;,Ljava/lang/ String;);
is a jsni method reference. But I don't know why it can not be wrapped and how it can be usedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It comes down to this: without more details or examples, we really have no idea what the author of the google style guide had in mind when they wrote it. If we want to make sure we are doing the right thing here, we should open an issue at https://github.com/google/styleguide?tab=readme-ov-file for clarification in this section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zopsss , please create issue on Google style to clarify reason of such special allowance for
long JSNI method reference
as it is wrap-able.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thankk youuuu 😺✨
Yeahh I don't think many people uses GWT compiler. But it's better to ask the community before moving on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear:
This means that you might be able to get a definitive answer on the line wrapping without waiting for a reply in your posts.
The style guide makes it sound like it’s not possible to do this, but if it is, then this statement from the style guide is either outdated or plain incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate what do you mean by definitive answer?
The style guide is really old, I guess the documentation is not changed since it was created so it is outdated.
As you can see at the time google_checks.xml was created, Checkstyle did not had support for comments/javadocs.
Support for google java style guide was introduced in 2014. Here's the GSoC project link https://github.com/checkstyle/checkstyle/wiki/Checkstyle-GSoC-2014-Project-Ideas#project-name-checkstyle-configuration-for-googles-java-style-guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am referring to the comment at #14501 (comment), if we are going to spend a bunch of time writing posts and waiting for replies, we can at least learn more about JSNI and see what the hubbub about line wrapping is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh okhay, I would love to do more research on JSNI but my mid-term exams coming and I'm also working on other issues too, it is really difficult to get some time for doing the research stuff. So it would be really helpful if you or other maintainer can find the reason about why there is need to ignore JSNI method for LineLength module. I'm really sorry for asking maintainers to do this. @nrmancuso