-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/squiz-inlinecomment-incorrect-no-blank-line-aft…
…er-comment-at-end-of-file' of https://github.com/jrfnl/PHP_CodeSniffer
- Loading branch information
Showing
7 changed files
with
184 additions
and
5 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
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
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
125 changes: 125 additions & 0 deletions
125
src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js.fixed
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,125 @@ | ||
// Some content here. | ||
var code = 'hello'; | ||
|
||
// This comment contains # multiple | ||
// hash signs (#). | ||
code = 'hello'; | ||
|
||
/** | ||
* This is the first line of a function comment. | ||
* This is the second line. | ||
*/ | ||
function testFunction() | ||
{ | ||
// Callback methods which are added by external objects. | ||
this.callbacks = {}; | ||
|
||
}//end testFunction() | ||
|
||
/** | ||
* This is the first line of a class comment. | ||
* This is the second line. | ||
*/ | ||
myClass.prototype = { | ||
|
||
/** | ||
* This is the first line of a method comment. | ||
* This is the second line. | ||
*/ | ||
load: function(url, callback) | ||
{ | ||
// Some code here. | ||
} | ||
}; | ||
|
||
// some code goes here! | ||
/* | ||
A longer comment goes here. | ||
It spans multiple lines!! | ||
Or does it? | ||
*/ | ||
|
||
// 0This is a simple multi-line | ||
// comment! | ||
code = 'hello'; | ||
|
||
// This is not valid. | ||
code = 'hello'; | ||
|
||
// Neither is this! | ||
code = 'hello'; | ||
|
||
code = 'hello'; | ||
|
||
/** Neither is this! **/ | ||
code = 'hello'; | ||
|
||
/** | ||
* This is the first line of a function comment. | ||
* This is the second line. | ||
*/ | ||
var myFunction = function() { | ||
} | ||
|
||
/** | ||
* This is the first line of a function comment. | ||
* This is the second line. | ||
*/ | ||
myFunction = function() { | ||
} | ||
|
||
/** | ||
* This is the first line of a function comment. | ||
* This is the second line. | ||
*/ | ||
myClass.myFunction = function() { | ||
} | ||
|
||
dfx.getIframeDocument = function(iframe) | ||
{ | ||
return doc; | ||
|
||
};//end dfx.getIframeDocument() | ||
|
||
mig.Gallery.prototype = { | ||
|
||
init: function(cb) | ||
{ | ||
|
||
},//end init() | ||
|
||
imageClicked: function(id) | ||
{ | ||
|
||
}//end imageClicked() | ||
|
||
}; | ||
|
||
// Here is some inline example code: | ||
// -> One | ||
// -> One.One | ||
// -> Two | ||
/* | ||
Here is some inline example code: | ||
-> One | ||
-> One.One | ||
-> Two | ||
*/ | ||
|
||
|
||
var foo = 'foo'; // Var set to foo. | ||
|
||
console.info(foo); | ||
|
||
// Comment here. | ||
console.info(foo); | ||
|
||
// ** | ||
* invalid comment | ||
*/ | ||
|
||
// some comment without capital or full stop | ||
console.log(foo); // An unrelated comment. | ||
|
||
// An unrelated comment. | ||
console.log(foo); // some comment without capital or full stop |
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