Skip to content

Issue #18228: supressed indentation check#18944

Open
Anushreebasics wants to merge 1 commit into
checkstyle:masterfrom
Anushreebasics:quotesleft
Open

Issue #18228: supressed indentation check#18944
Anushreebasics wants to merge 1 commit into
checkstyle:masterfrom
Anushreebasics:quotesleft

Conversation

@Anushreebasics

Copy link
Copy Markdown
Contributor

fixes #18228
Root Cause: The [IndentationCheck] was checking line-wrapping indentation for all text block quotes, even when they legitimately appear at column 0 per Google style.

Solution: Modified the indentation check to suppress violations for text block quotes at column 0.

@Anushreebasics

Anushreebasics commented Feb 16, 2026

Copy link
Copy Markdown
Contributor Author

@romani @mohitsatr please review this PR

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@romani please review

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@romani please review this PR

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@romani please review

@romani

romani commented Feb 19, 2026

Copy link
Copy Markdown
Member

My concern is that this is Google's style issue, but fix is done in general implementation.
Others might not like this behavior.

@vivek-0509, please share your thoughts on this update

@Anushreebasics Anushreebasics force-pushed the quotesleft branch 2 times, most recently from 2f42415 to c912486 Compare February 20, 2026 06:41
@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@vivek-0509 please review, I have changed the fix to only concern Google's style

@vivek-0509

Copy link
Copy Markdown
Member

@romani
I agree with the concern, we should not modify the IndentationCheck for this. It's a general-purpose check, and this column-0 text block allowance is specific to Google's style guide. The OpenJDK style guide (v6) and Sun/Oracle convention have no such rule, and we will likely add this check in both those check config files in the future.

i think this can be achieved through a SuppressionXpathSingleFilter in google_checks.xml instead.
Also, looking at the changes done in the PR to make it customizable for Google style by adding a new property and keeping the default to false for other cases, but the fix only modifies shouldProcessTextBlockLiteral() in LineWrappingHandler, this only covers some cases and looks like a partial fix. Cases stated below will still have violations, but generally are rare cases but we should cover them

getData(
"""
        content
""",
        5);

public String getQuery() {
    return     
"""                 //  column 0, this is what gets flagged
returned content
""";                //  column 0, also flagged
}

Lets try the SuppressionXpathSingleFilter approach if we can achieve this through that.
What do you think ??

@vivek-0509

Copy link
Copy Markdown
Member

@Anushreebasics You can close the PR the issue is resolved

@romani

romani commented Mar 20, 2026

Copy link
Copy Markdown
Member

@Anushreebasics, please create issue on Indentation Check, with default confirmation .

We need to detach your update from Google style.
New property might make sense, let's review it from start with new issue.

We can close this PR, for now. Code can be reused in new PR for new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False-positive: Suppress indentation check when quotes start at the left margin

3 participants