google / google/google-java-format

Tab characters are not removed from single line comment

Open
#1,149 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.2k
Forks
937
Avg merge
6m
Merged PRs (30d)
3

Description

content with tab:
```
public class Test {
/**
* The client's first name.
*
* @serialField serial String some test some testsome testsome testsome testsome testsome test
* Path components separated by separator loooooooooooooooonooooooooooooooooooooog.
*/
public String thirdName;
// here is tab .
private serial serial;
}
```

visualization of tabs and formatting:
```
$ cat -A Test.java
public class Test {$
/**$
* The client's first name.$
*$
* @serialField serial String some test some testsome testsome testsome testsome testsome test$
* ^I^I^IPath components separated by separator loooooooooooooooonooooooooooooooooooooog.$
*/$
public String^IthirdName;$
// here is tab ^I.$
private serial^Iserial;$
}$

$ java -jar google-java-format-1.23.0-all-deps.jar Test.java > TestUpdated.java

$ cat -T TestUpdated.java
public class Test {
/**
* The client's first name.
*
* @serialField serial String some test some testsome testsome testsome testsome testsome test
* Path components separated by separator loooooooooooooooonooooooooooooooooooooog.
*/
public String thirdName;

// here is tab ^I.
private serial serial;
}
```

all tabs are removed except for singleline comment

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.