-
Notifications
You must be signed in to change notification settings - Fork 134
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
Exclude javadoc @link from linelength #2414
Conversation
Thanks for your interest in palantir/gradle-baseline, @proggeo! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
Generate changelog in
|
@@ -49,7 +49,7 @@ | |||
</module> | |||
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping --> | |||
<property name="max" value="120"/> | |||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/> | |||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://|\* \{@link"/> |
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 think just the {@link
piece is sufficient, no need to match * {@link
, this way we match a href
handling.
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.
imo we should still encourage shorter lines. i.e., something like
* My amazing function runs the eternal engine. See {@link com.superlongcorpname.thebestteamever.AmazingEternalEngine#runThisSuperDuperAmazingEngine}
should still be forced to look like
* My amazing function runs the eternal engine. See
* {@link com.superlongcorpname.thebestteamever.AmazingEternalEngine#runThisSuperDuperAmazingEngine}
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 get that, however consistency is more important with this sort of thing than optimality.
For example, how would this work in the context of a list in javadoc (or other nested structure used in high-quality documentation).
If we want to bike-shed on optimality, the following results in the smallest maximum line length, but isn't covered by either suppression (which is fine imo because it matches the behavior of a href
!)
/**
* My amazing function runs the eternal engine. See {@link
* com.superlongcorpname.thebestteamever.AmazingEternalEngine#runThisSuperDuperAmazingEngine
* }
*/
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.
lgtm, thanks!
Released 4.180.0 |
###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. # Release Notes ## 4.180.0 | Type | Description | Link | | ---- | ----------- | ---- | | Improvement | exempt @link javadoc comment from LineLength check | palantir/gradle-baseline#2414 | To enable or disable this check, please contact the maintainers of Excavator.
@link
in javadoc should not break into multiple linesBefore this PR
Using
@link
with a long reference would trigger LineLength violation.After this PR
@link
javadoc comment lines are exempted from LineLength checkPossible downsides?