-
Notifications
You must be signed in to change notification settings - Fork 11
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
allow long lines in block comments and whole strings #84
Conversation
<!-- Allow longer lines in comments. --> | ||
<property name="ignorePattern" value="^ \*.*"/> | ||
<!-- Allow longer lines in block comments and whole string literals --> | ||
<property name="ignorePattern" value='^ +\*|"[^"]{100,}"'/> |
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.
fix: allow 1 or more space in block comments, so it works for block comments at any level.
new: if the line is mostly a string of more than 100 characters, then leave it. these are often test inputs.
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.
examples that are allowed now for line length:
/**
* javadoc comments for fields and methods, not just class-level
*/
strings without unnecessary breaks:
String id =
"pkg:hf-model/org/repo/path%2Fto%2Fmodel@commit-hash?classifier=format&sonatype_repository=huggingface.co&type=ext";
parameters in CSV format in data-driven tests:
@CsvSource({
"conan, cctz, 2.3, , , pkg:conan/[email protected]?sonatype_naming_authority=conan",
"bincrafters, cctz, 2.3, bincrafters, stable, pkg:conan/bincrafters/[email protected]?channel=stable&sonatype_naming_authority=bincrafters"
})
if it's a shorter string in a long parameter list or something, that could be wrapped sensibly, then it's still triggered.
<groupId>com.puppycrawl.tools</groupId> | ||
<artifactId>checkstyle</artifactId> | ||
<version>8.42</version> | ||
</dependency> |
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.
default checkstyle that comes with the plugin is fine.
<dependency> | ||
<groupId>com.sonatype</groupId> | ||
<artifactId>checkstyle-checks</artifactId> | ||
<version>15</version> | ||
<version>20</version> |
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.
20 will be the next release.
fix a bug: javadocs deeper than class-level were note allowed to go long like class-level docs would.
enhancement: long, contiguous strings are allowed without requiring introduction of messy breaks.