-
Notifications
You must be signed in to change notification settings - Fork 440
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
Indent spacesPerTab doesn't work #1894
Comments
So, after reading sources of spotless finally I understand what happened with my indentation. Spotless can not change indentation when converting from spaces to spaces. Always I need tabs step in the middle. Another insight was that
Could you make it more clear in documentation? At https://github.com/diffplug/spotless/tree/main/plugin-maven I have very clear example of converting from spaces to tabs. But converting from spaces to different spaces cost me two days of experimenting and source reading. |
Sorry for the lost time, agree the names are misleading.
|
Just a random idea, since people are using two indent steps, I could also imagine the following way to configure it <convertTabsToSpaces><spacesPerTab>4</spacesPerTab></convertTabsToSpaces>
<convertSpacesToTabs><spacesPerTab>4</spacesPerTab></convertSpacesToTabs>
<convertIndentSpaces><from>4</from><to>2</to></convertIndentSpaces> |
If you are submitting a bug, please include the following:
I'm trying to auto-format my code with 4 spaces indentation. But I get only 2 spaces indentation.
Example of result (2 spaces before fields):
spotless version
<spotless.version>2.40.0</spotless.version>
operating system and version
MacOS Ventura 13.6.1
copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
from
pom.xml
:I tried different indent configurations. In all of them I can get only tabs or 2 spaces. No 4 spaces configuration found.
gradlew spotless[Apply/Check] --stacktrace
I'm not sure that I understand how to get stacktrace from maven spotless:apply.
The output of spotless:apply looks good. It formats all my files (I've done
mvn clean
before run) but formatting not good enough.The text was updated successfully, but these errors were encountered: