Draft
Conversation
The code formatter accepts manual placed line breaks in function calls.
It will for example no longer remove a new line character after the
opening parenthesis of a function call.
A code formatting like this is now possible:
my_object.setMessage(
"Some text that describes the value x=" + x);
and lambda expressions.
Allows to programmer to more freely place line breaks in method
declarations. Now this is possible:
private PluginInfo<SciJavaPlugin> createInfo(
final IndexItem<Plugin> item, final ClassLoader classLoader)
{
...
}
It's now possible to have a new line directly after the opening
parenthesis in a try-with-resource statement. Like here:
try (
final DataHandle<Location> sourceHandle = dataHandleService.create(source);
final DataHandle<Location> cachedHandle = dataHandleService.create(cached);
final DataHandle<Location> destHandle = dataHandleService.create(destination)
)
{
...
}
Allows to have longer uninterrupted lines of code. But also allows to manually place line breaks to better organize your code into shorter lines.
The code formatting inside javadoc unfortunately destroys the javadoc.
It destroys tags like {@code } and introduces line breaks that change
the layout of your javadoc.
Therefore the code formatting in javadoc is disabled.
A long expressions that occupies multiple lines of code often benefits from manually placed line breaks. This allows to organize the equation in a logical manner. The code formatter no longer removes those manual line breaks.
An if statement is now formatted like this:
if (list.isEmpty())
return null;
The code formatter now indents enum classe like normal classes with one tab character.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This draft PR is only here to demonstrate the suggested changes to the scijava-codings-style.
The individual commits show the impact of each individual change.