-
Notifications
You must be signed in to change notification settings - Fork 163
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
Modify/reformat source with some sane formatting #1902
Comments
I agree, in general I never liked the fact that it will indent continued lines past the end of the first line. It pushes some lines way off to the right. I hope it's fixable, the Google format is notoriously difficult to configure IIRC. |
JBang uses Eclipse formatter as I see, at least spotless config points at |
In that case 👍 |
its 5 years since I last edited the formatting rules...I'm used to it now so I just edit code and let the formatter apply L) but PRs welcome assume it makes things better and doesn't reformat the world completely :) |
https://github.com/google/google-java-format, perhaps?
IMHO a one time bulk reformat everything is not the end of the world. There's also |
This eliminates many cases of extreme indentation Fixes jbangdev#1902
Take a look at the PR I just created: #1933 To me that's a lot better, but what do you think? Edit: btw, this uses "default indentation" which still uses 2 tabs for each line, eg: List<Dependency> mdeps = boms.stream()
.flatMap(d -> getManagedDependencies(strictSession, d).stream())
.collect(Collectors.toList()); but also gb
.setArguments(userParams)
.runtimeOptions(runMixin.javaRuntimeOptions)
.mainClass(buildMixin.main)
.moduleName(buildMixin.module)
.debugString(runMixin.debugString)
.classDataSharing(runMixin.cds); So not sure if we'd want to change that to the option that only indents with a single tab. Personally I only use a single indent in those cases, but not sure what others' preferences are. |
hmm - I thought it was formatting with closest tab not fixed 2 tab indent? btw. the pr does look better but not merging it just yet in case another tweak is found reformatting the world again ;) |
Perhaps, but it would look at the next tab after the last char on the previous line. Which means that if that line was very long the following lines would be indented a ridiculous amount.
Sure. Btw, I don't think it was really that big of a change. Yes, it touches a pretty large amount of files, but surprisingly it doesn't change that many lines. |
Is your feature request related to a problem? Please describe.
I'm always frustrated when looking at the code 😄
Describe the solution you'd like
Apply some "normal" code formatting, as this (failed by spotless and then "reformatted" by spotless) is insane:
d33f99d
Describe alternatives you've considered
Some modern and normal formatting, as 80 width is long past current screen estates.
Additional context
This formatting
d33f99d
vs this one (both are quite "fluent"):
https://github.com/apache/maven/blob/master/impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLifecycleRegistry.java
The text was updated successfully, but these errors were encountered: