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

Reformat the formatter #1185

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private void advance() {
if (idx + 1 < input.length() && input.charAt(idx + 1) == '\n') {
idx++;
}
// falls through
// falls through
case '\n':
idx++;
curr = idx;
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/com/google/googlejavaformat/OpsBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
public final class OpsBuilder {

/** @return the actual size of the AST node at position, including comments. */
/** Returns the actual size of the AST node at position, including comments. */
public int actualSize(int position, int length) {
Token startToken = input.getPositionTokenMap().get(position);
int start = startToken.getTok().getPosition();
Expand All @@ -57,7 +57,7 @@ public int actualSize(int position, int length) {
return end - start;
}

/** @return the start column of the token at {@code position}, including leading comments. */
/** Returns the start column of the token at {@code position}, including leading comments. */
public Integer actualStartColumn(int position) {
Token startToken = input.getPositionTokenMap().get(position);
int start = startToken.getTok().getPosition();
Expand Down Expand Up @@ -316,7 +316,7 @@ public final void guessToken(String token) {
token,
Doc.Token.RealOrImaginary.IMAGINARY,
ZERO,
/* breakAndIndentTrailingComment= */ Optional.empty());
/* breakAndIndentTrailingComment= */ Optional.empty());
}

public final void token(
Expand Down Expand Up @@ -359,7 +359,7 @@ public final void op(String op) {
op.substring(i, i + 1),
Doc.Token.RealOrImaginary.REAL,
ZERO,
/* breakAndIndentTrailingComment= */ Optional.empty());
/* breakAndIndentTrailingComment= */ Optional.empty());
}
}

Expand Down Expand Up @@ -427,7 +427,7 @@ public final void breakToFill(String flat) {
* @param plusIndent extra indent if taken
*/
public final void breakOp(Doc.FillMode fillMode, String flat, Indent plusIndent) {
breakOp(fillMode, flat, plusIndent, /* optionalTag= */ Optional.empty());
breakOp(fillMode, flat, plusIndent, /* optionalTag= */ Optional.empty());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,3 @@ private static boolean javadocShaped(List<String> lines) {
return true;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void append(String text, Range<Integer> range) {
if (i + 1 < text.length() && text.charAt(i + 1) == '\n') {
i++;
}
// falls through
// falls through
case '\n':
spacesPending = new StringBuilder();
++newlinesPending;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public final class FormattingFiler implements Filer {
private final Formatter formatter = new Formatter();
private final Messager messager;

/** @param delegate filer to decorate */
/**
* @param delegate filer to decorate
*/
public FormattingFiler(Filer delegate) {
this(delegate, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
final class JavadocWriter {
private final int blockIndent;
private final StringBuilder output = new StringBuilder();

/**
* Whether we are inside an {@code <li>} element, excluding the case in which the {@code <li>}
* contains a {@code <ul>} or {@code <ol>} that we are also inside -- unless of course we're
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
* Tests for command-line flags.
*/
/** Tests for command-line flags. */
@RunWith(JUnit4.class)
public class CommandLineFlagsTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ public void paragraphTag() {
@Test
public void xhtmlParagraphTag() {
String[] input = {
"class Test {",
"class Test {", //
" /**",
" * hello<p/>world",
" */",
Expand All @@ -1093,7 +1093,7 @@ public void xhtmlParagraphTag() {
"}",
};
String[] expected = {
"class Test {",
"class Test {", //
" /**",
" * hello",
" *",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ private List<Range<Integer>> rangesFromRegions(IRegion[] regions) {
return ranges;
}

/** @return {@code true} if input and output texts are equal, else {@code false}. */
/**
* @return {@code true} if input and output texts are equal, else {@code false}.
*/
private boolean idempotent(String source, IRegion[] regions, List<Replacement> replacements) {
// This implementation only checks for single replacement.
if (replacements.size() == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ private void createUIComponents() {
false));
}

/** @noinspection ALL */
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return panel;
}
Expand Down
Loading