Skip to content

Update IndentStep to allow leading space on multi-line comments#1072

Merged
nedtwigg merged 5 commits intodiffplug:mainfrom
vpavic:gh-1070
Jan 7, 2022
Merged

Update IndentStep to allow leading space on multi-line comments#1072
nedtwigg merged 5 commits intodiffplug:mainfrom
vpavic:gh-1070

Conversation

@vpavic
Copy link
Copy Markdown

@vpavic vpavic commented Jan 6, 2022

At present, indentWithTabs doesn't handle leading space on multi-line comments and reports errors on properly formatted code.

This commit updates IndentStep to add support for detecting multi-line comments and allowing a single leading space for such lines.

Closes #1070

Copy link
Copy Markdown
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start, almost there :)

Comment thread lib/src/main/java/com/diffplug/spotless/generic/IndentStep.java Outdated
Comment thread lib/src/main/java/com/diffplug/spotless/generic/IndentStep.java Outdated
Comment thread testlib/src/main/resources/indent/IndentedWithTab.test Outdated
Comment thread testlib/src/test/java/com/diffplug/spotless/generic/IndentStepTest.java Outdated
vpavic added 2 commits January 6, 2022 19:35
At present, `indentWithTabs` doesn't handle leading space on multi-line comments and reports errors on properly formatted code.

This commit updates `IndentStep` to add support for detecting multi-line comments and allowing a single leading space for such lines.

Closes diffplug#1070
@nedtwigg nedtwigg disabled auto-merge January 6, 2022 19:10
@nedtwigg nedtwigg enabled auto-merge January 6, 2022 19:10
auto-merge was automatically disabled January 6, 2022 19:30

Head branch was pushed to by a user without write access

@vpavic
Copy link
Copy Markdown
Author

vpavic commented Jan 6, 2022

I pushed an additional commit that fixes the code style issue that caused the CI build to fail.

@nedtwigg note that I did run ./gradlew check locally and the build was successful - I'd expect this to cover all the project's check tasks.

@nedtwigg nedtwigg enabled auto-merge January 6, 2022 23:52
@nedtwigg nedtwigg merged commit 542546c into diffplug:main Jan 7, 2022
@vpavic vpavic deleted the gh-1070 branch January 7, 2022 08:49
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.

indentWithTabs ought to preserve C-style multiline comments

2 participants