Visualize CR and LF symbols
See original GitHub issueCR and LF are invisible in Spotless output.
For instance:
src/core/src/main/java/org/apache/jmeter/SplashScreen.java
@@ -52,7 +52,7 @@
setLocationRelativeTo(null);\n
}\n
\n
- private int x=2;\r\n
+ private int x=2;\n
\n
/**\n
* Show screen\n
So far so good. Spotless shows that \n
should not be there (which is true because I’m on macOS, and lines should end with LF).
However, if I add one more line with “trailing whitespace”, then the output becomes
src/core/src/main/java/org/apache/jmeter/SplashScreen.java
@@ -53,7 +53,7 @@
····}
·····private·int·x=2;
-·····private·int·y=3;··
+·····private·int·y=3;
····/**
·····*·Show·screen
Note: x=2
still has the wrong line ending, however, spotless does not print a warning on that.
spotlessApply
corrects both issues (newline and the trailing whitespace).
Have you considered to use unicode characters like SYMBOL FOR CARRIAGE RETURN, ␍ SYMBOL FOR LINE FEED, ␊ ?
Then the output could be like
src/core/src/main/java/org/apache/jmeter/SplashScreen.java
@@ -53,7 +53,7 @@
····}
-·····private·int·x=2;␍␊
-·····private·int·y=3;··␊
-·····private·int·x=2;␊
+·····private·int·y=3;␊
····/**
·····*·Show·screen
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
How do I visualize CR LF in WORD? - Super User
Visual symbols for Carriage-Return and Line-Feed. For exactly this purpose, there are Unicode control pictures for CR and LF
Read more >Visualize CR and LF symbols · Issue #465 · diffplug/spotless
CR and LF are invisible in Spotless output. For instance: src/core/src/main/java/org/apache/jmeter/SplashScreen.java @@ -52, ...
Read more >How to properly format your logo carriage return (CR LF to LF)
In Notepad++ go to the View > Show Symbol menu and select Show End of Line. Once you select View > Show Symbol...
Read more >How do I show/hide the "CR" and "LF" text at the end of the ...
From the edit point to the end of the file now shows the CR LF symbols in reverse (black rounded corner boxes with...
Read more >CRLF - MDN Web Docs Glossary: Definitions of Web-related ...
CR and LF are control characters or bytecode that can be used to mark a line break in a text file.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Running Spotless with
file.encoding=ISO-8859-1
produces something likeIn other words, Spotless should probably refrain from using characters that are not encodable with
file.encoding
.In other words, there should probably be two styles of “whitespace visualization”, and the default one should be selected based on the encoding capabilities.
Migrated to https://github.com/autostyle/autostyle/issues/2