-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improvements in line breaks #15
Comments
Yeah, those are hard. One improvement that they do suggest to me is that when a value does not fit on the same line with the key, it might make sense to always (?) start it on the next line instead, using an escaped newline. Or are there cases where that would be worse choice than the current one? |
Yes, always starting on the next line when a value does not fit on the same line with the key sounds like a good and safe idea. I was also thinking about other heuristics, but I'm not sure they always apply:
|
This would not really work for property values that are e.g. localizable text.
In practice that would probably mean dropping this line, which should be pretty safe. Or maybe replacing it with Note that the changes under consideration are required in |
Using version 0.3.0, with
printWidth: 140
andkeySeparator: '='
configuration.I'm not sure what rules could be inferred, but on these examples the properties before transformation are easier to read.
Before
sonar.cpd.exclusions=\ src/main/java/tech/jhipster/lite/error/infrastructure/primary/ArgumentsReplacer.java,\ src/main/java/tech/jhipster/lite/module/domain/file/ArgumentsReplacer.java
After
sonar.cpd.exclusions=src/main/java/tech/jhipster/lite/error/infrastructure/primary/ArgumentsReplacer.\ java,src/main/java/tech/jhipster/lite/module/domain/file/ArgumentsReplacer.java
Another example:
Before
sonar.exclusions=\ src/main/webapp/main.ts, \ src/main/webapp/app/main.ts, \ src/main/webapp/content/**/*.*, \ src/main/webapp/i18n/*.js, \ target/classes/static/**/*.*, \ src/main/resources/**, \ src/main/webapp/app/router/index.ts, \ src/main/glyph/css/**, \ src/main/webapp/app/common/primary/applicationlistener/WindowApplicationListener.ts
After
sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, \ target/classes/static/**/*.*, src/main/resources/**, src/main/webapp/app/router/index.ts, src/main/glyph/css/**, \ src/main/webapp/app/common/primary/applicationlistener/WindowApplicationListener.ts
Another example:
Before
assertion-error.STRING_TOO_LONG.detail=\ Content of {{ field }} is too long, must be less than {{ maxLength }} character(s) (was {{ currentLength }})
After
assertion-error.STRING_TOO_LONG.detail=Content of {{ field }} is too long, must be less than {{ maxLength }} character(s) (was {{ \ currentLength }})
The text was updated successfully, but these errors were encountered: