Skip to content
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

Add information on how to change indent #622

Merged
merged 2 commits into from
Nov 26, 2023

Conversation

koppor
Copy link
Contributor

@koppor koppor commented Nov 17, 2023

What changed with this PR:

More beginner-friendly documentation.

When coming from google-java-format --ASOP or palantir-java-format, it is not that obvious how to use prettier-java. Adding some lines of documentation makes it obvious (and thus this project is more beginner-friendly)

Relative issues or prs:

Fixes #495.

@CLAassistant
Copy link

CLAassistant commented Nov 17, 2023

CLA assistant check
All committers have signed the CLA.

@murdos
Copy link

murdos commented Nov 17, 2023

I think it would be better to redirect to the prettier documentation rather than documenting again each configuration parameter.

@koppor
Copy link
Contributor Author

koppor commented Nov 17, 2023

I think it would be better to redirect to the prettier documentation rather than documenting again each configuration parameter.

My two main reasons:

I aimed for documenting the WTF configuration parameters, not all. Sun Java style is 4 spaces. Nearly all Java code has 4 saves. Default configuration is 2 spaces, which might cause WTF moments.

The prettier configuration is not that obvious for impatient people outside the NodeJS world.

I am open to remove the tab configuration - this is only needed for projects wanting to be more accessible. This might be not worth to make it prominent. Persons caring for exceptional groups are surely able to read and interpet linked documentation.

Some background material,:

Tabs are objectively better than spaces (due to accessibility reasons): https://gomakethings.com/tabs-are-objectively-better-than-spaces/

Another accessibility reason for tabs: when using a braille display, each space takes up one character cell, so indenting with four spaces eats up four cells. Indenting three times with four spaces each eats up 12 characters already. Tabs only take one character cell each, so three indents = three character cells used.

Given many, if not most, braille displays are 40 cells long, and that 70-to 80-cell displays are considered a luxury, and you can see how cutting 12 space characters down to 3 tab characters could be really, really helpful.

@koppor
Copy link
Contributor Author

koppor commented Nov 18, 2023

I got the idea of having the indent configuration in the main README.md from spring-javaformat at https://github.com/spring-io/spring-javaformat#about-the-conventions.

@clementdessoude clementdessoude merged commit f9c749e into jhipster:main Nov 26, 2023
2 checks passed
@koppor koppor deleted the patch-2 branch November 26, 2023 16:29
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.

How to convert Spaces to tabs
5 participants