You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better names for indentWithSpaces and indentWithTabs #794
So I have this simple groovy formatter just to ensure that all files Groovy and Groovy related files end with newlines and are indented using 4 spaces. However, when I run ./gradlew spotlessApply, files that are indented with 2 spaces are not converted. Here is the block:
I am not using the groovy formatter because I have Jenkins script files that are located outside of source sets. So according to the documentation, this should work, since I have defined the target file name matcher, and the rules I want applied.
Ah, that's interesting. It should at the very least be renamed to remove the confusion, like tabsToSpaces() or something similar. I can create a PR for it.
Reacted by Jonathan Bluett-Duncan and Mouhcine Aitounejjar
@jbduncan@wheelerlaw@alexvetter I have the issue that indent does not work with palandir #2204
Did this fix fix the issue? If yes, which config I need to put to my pom.xml? Thanks
Activity
jbduncan commentedon Feb 10, 2021
Ah, that's something with
indentWithSpaces()that people get confused about a lot. (I was confused about it in the past too!)indentWithSpaces()doesn't translate stuff that already has spaces from e.g. 2 spaces per indent to 4 spaces; it only translates tabs to 4 spaces.See @nedtwigg's rationale for this over at #58 (comment). tl;dr: it would clobber spaces in Javadoc comments otherwise.
wheelerlaw commentedon Feb 10, 2021
Ah, that's interesting. It should at the very least be renamed to remove the confusion, like
tabsToSpaces()or something similar. I can create a PR for it.nedtwigg commentedon Feb 10, 2021
leadingTabsToSpacesandleadingSpacesToTabsare better names, good call! Important checklist for the old methods:replace 'foo' with 'bar' in your gradle buildscript[-]Simple custom Groovy linter not working[/-][+]Better names for `indentWithSpaces` and `indentWithTabs`[/+]jbduncan commentedon Apr 27, 2021
@wheelerlaw If you're still willing and able to create a PR for this issue, then please feel free to go ahead. :)
PaulNgo-BlueOC commentedon Aug 12, 2024
@jbduncan @wheelerlaw @alexvetter I have the issue that indent does not work with palandir
#2204
Did this fix fix the issue? If yes, which config I need to put to my pom.xml? Thanks
feat: add new api for indentation spaces vs. tabs
feat: test new api for indentation spaces vs. tabs
feat: test new api for indentation spaces vs. tabs
doc: add documentation for new api
doc: add documentation for new api
doc: add documentation for new api
feat: add new api for indentation spaces vs. tabs
feat: test new api for indentation spaces vs. tabs
doc: add documentation for new api
feat: clarify indent format option api (#2350 fixes #794)
nedtwigg commentedon Jan 7, 2025
Released in
plugin-gradle 7.0.0andplugin-maven 2.44.0chore(build) version upgrades: Gradle 6.0.1 -->> 9.1.0; spotless grad…