This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix no-trailing-whitespace for comments and EOF (#2060)
Detect trailing whitespace in comments. Detect trailing whitespace before EOF. Add fixer. Fixes: #2049
- Loading branch information
Showing
4 changed files
with
88 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Clazz { | ||
public funcxion() { | ||
console.log("test") ; | ||
} | ||
|
||
|
||
private foobar() { | ||
} | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class Clazz { | ||
public funcxion() { | ||
console.log("test") ; | ||
} | ||
|
||
|
||
private foobar() { | ||
} | ||
} | ||
// single line comment without trailing whitespace | ||
// single line comment with trailing whitespace | ||
/* single line multiline comment */ | ||
/* whitespace after comment */ | ||
/* first line has trailing whitespace | ||
second line is ok | ||
last line is not checked */ | ||
/* | ||
*/ | ||
|
||
// following line checks for trailing whitespace before EOF |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
class Clazz { | ||
public funcxion() { | ||
~~~~ [0] | ||
~~~~ [trailing whitespace] | ||
console.log("test") ; | ||
~~~~ [0] | ||
~~~~ [trailing whitespace] | ||
} | ||
|
||
~~~~ [0] | ||
~~~~ [trailing whitespace] | ||
|
||
~~~~ [0] | ||
~~~~ [trailing whitespace] | ||
private foobar() { | ||
} | ||
} | ||
~~~~ [0] | ||
~~~~ [trailing whitespace] | ||
// single line comment without trailing whitespace | ||
// single line comment with trailing whitespace | ||
~~~ [trailing whitespace] | ||
/* single line multiline comment */ | ||
/* whitespace after comment */ | ||
~ [trailing whitespace] | ||
/* first line has trailing whitespace | ||
~~ [trailing whitespace] | ||
second line is ok | ||
last line is not checked */ | ||
/* | ||
*/ | ||
|
||
[0]: trailing whitespace | ||
// following line checks for trailing whitespace before EOF | ||
|
||
~~~ [trailing whitespace] |