Closed Zhenye-Na closed 5 months ago
to the best of my knowledge, palantir-java-format does not have a config point to allow you to control how many spaces you want to appear. (See the current formatter CLI options).
This is an intentional design decision of the project, because we were really trying to drive homogeneity across hundreds of java projects and specifically wanted to:
See more about this intention in the README: https://github.com/palantir/palantir-java-format?tab=readme-ov-file#upsides-of-automatic-formatting
Hello @iamdanfox
Thanks for the reply. I understood the pros and cons, thats the reason why we prefer palantir
formatter to google
style.
But I am not sure if my question is answered, are you saying that the issue I mentioned above is by design, which makes Record
class's indentation to be 8
spaces?
Thanks
At the moment, that is palantir-java-format's behaviour when it wraps arguments to a record constructor.
What happened?
I have configured
4
spaces for my java project, but after the formatting, the java file of multipleRecord
is reindented to8
spacesI have attached an example of formatted class. I used numbers to represent spaces for the first member variable
What did you want to happen?
Record
class should also be4
spaces