-
Notifications
You must be signed in to change notification settings - Fork 99
Suppress Checkstyle within text-blocks #323
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,13 @@ | |
| "-//Puppy Crawl//DTD Check Configuration 1.3//EN" | ||
| "http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd"> | ||
| <module name="Checker"> | ||
| <!-- TODO: Remove this supression once RegexpMultiline has been replaced with an AST aware check --> | ||
| <!-- This suprpresses Checkstyle between onccurences of """", i.e. text blocks --> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: suprpresses -> suppresses |
||
| <module name="SuppressWithPlainTextCommentFilter"> | ||
| <property name="offCommentFormat" value='=\s+"""'/> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why |
||
| <property name="onCommentFormat" value='^\s+.*""";'/> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Take into consideration the following use case:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, that makes it slightly challenging. Since we need some way to differentiate opening and closing text block markers. One way to do this is to enforce all text-block content appears on a newline by changing start marker to Changing closing marker to Any suggestions?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess your solution is based on the proposal checkstyle/checkstyle#11653 (comment) What if we use something like: ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That covers most of the cases we know of. Thanks. Hopefully this is a short term solution so we don't need to make it pretty.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are a few minor variations when dealing with NOTE that I tested this so far only on regex101.com and not with the changes on your branch.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
i think this is important. while not allow the text blocks are awesome for SQL queries and SQL queries are awesome to inline in tests, so this would be primary use-case |
||
| </module> | ||
|
|
||
| <module name="FileTabCharacter" /> | ||
| <module name="NewlineAtEndOfFile"> | ||
| <property name="lineSeparator" value="lf" /> | ||
|
|
||
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.
What can be done here?